Skip to content

Commit 06a392e

Browse files
committed
test: pass CI checks
1 parent 3ecdcca commit 06a392e

File tree

6 files changed

+38
-24
lines changed

6 files changed

+38
-24
lines changed

copier_template_tester/_write_output.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,9 @@ def _remove_readonly(func, path: str, _excinfo) -> None: # noqa: ANN001
141141
def write_output(
142142
*,
143143
src_path: Path,
144-
dst_path: Path, data: dict[str, bool | int | float | str | None],
145-
extra_tasks: list[str | list[str] | dict] | None = None,
144+
dst_path: Path,
145+
data: dict[str, bool | int | float | str | None],
146+
extra_tasks: list[str | list[str] | dict[str, str | list[str]]] | None = None,
146147
**kwargs,
147148
) -> None:
148149
"""Copy the specified directory to the target location with provided data.

docs/docs/CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22

33
### Feat
44

5-
- add option to run extra tasks in each generated project
5+
- add support for `_extra_tasks` in CTT TOML configuration (#36)
6+
7+
## 2.1.4 (2024-11-19)
8+
9+
### Fix
10+
11+
- **#34**: support `git init` on Windows (#35)
612

713
## 2.1.3 (2024-07-08)
814

docs/docs/DEVELOPER_GUIDE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ poetry config pypi-token.pypi ...
5151
| `copier_template_tester/_config.py` | 14 | 0 | 3 | 100.0% |
5252
| `copier_template_tester/_pre_commit_support.py` | 13 | 0 | 0 | 93.3% |
5353
| `copier_template_tester/_runtime_type_check_setup.py` | 13 | 0 | 37 | 100.0% |
54-
| `copier_template_tester/_write_output.py` | 81 | 1 | 16 | 98.9% |
55-
| `copier_template_tester/main.py` | 30 | 4 | 20 | 86.7% |
56-
| **Totals** | 155 | 5 | 76 | 96.4% |
54+
| `copier_template_tester/_write_output.py` | 83 | 1 | 16 | 98.9% |
55+
| `copier_template_tester/main.py` | 32 | 4 | 20 | 87.5% |
56+
| **Totals** | 159 | 5 | 76 | 96.5% |
5757

58-
Generated on: 2024-11-19
58+
Generated on: 2025-02-06
5959
<!-- {cte} -->

tests/data/copier_demo/.ctt/no_all/.copier-answers.testing_no_all.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Answer file maintained by Copier for: https://github.com/KyleKing/calcipy_template
33
# Check into version control. Edit by re-running copier and changing responses to the questions
44
_src_path: ../../copier_demo
5-
copyright_date: '2024'
5+
copyright_date: '2025'
66
include_all: false
77
minimum_python: 3.11.0
88
package_name_py: testing_no_all

tests/data/copier_demo/.ctt/no_all/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
Works with Python=3.11
44

5-
Copyright: 2024
5+
Copyright: 2025

tests/test_main.py

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import pytest
55
from corallium.log import get_logger
66
from pytestshellutils.shell import Subprocess
7+
from pytestshellutils.utils.processes import MatchString
78

89
from copier_template_tester.main import run
910

@@ -27,20 +28,24 @@ def _run_copy(worker) -> None:
2728
run(base_dir=base_dir)
2829

2930

30-
def check_run_ctt(*, shell: Subprocess, cwd: Path, subdirname: str) -> set[Path]:
31+
def check_run_ctt(*, shell: Subprocess, cwd: Path, subdirname: str) -> tuple[set[Path], MatchString]:
3132
ret = run_ctt(shell, cwd=cwd)
3233

3334
assert ret.returncode == 0, ret.stderr
3435
# Check output from ctt and copier (where order can vary on Windows)
35-
ret.stdout.matcher.fnmatch_lines([
36-
'Starting Copier Template Tester for *',
37-
'*Note: If files were modified, pre-commit will report a failure.',
38-
'',
39-
f'Using `copier` to create: .ctt/{subdirname}',
40-
])
41-
ret.stderr.matcher.fnmatch_lines_random([
42-
'*Copying from template*',
43-
])
36+
ret.stdout.matcher.fnmatch_lines(
37+
[
38+
'Starting Copier Template Tester for *',
39+
'*Note: If files were modified, pre-commit will report a failure.',
40+
'',
41+
f'Using `copier` to create: .ctt/{subdirname}',
42+
],
43+
)
44+
ret.stderr.matcher.fnmatch_lines_random(
45+
[
46+
'*Copying from template*',
47+
],
48+
)
4449
# Check a few of the created files:
4550
return {pth.relative_to(cwd) for pth in (cwd / '.ctt').rglob('*.*') if pth.is_file()}, ret.stdout
4651

@@ -51,11 +56,13 @@ def test_main(shell: Subprocess) -> None:
5156
assert Path('.ctt/no_all/README.md') in paths
5257
assert Path('.ctt/no_all/.copier-answers.testing_no_all.yml') in paths
5358
assert Path('.ctt/no_all/.copier-answers.yml') not in paths
54-
stdout.matcher.fnmatch_lines_random([
55-
'task_string',
56-
'task_list',
57-
'task_dict',
58-
])
59+
stdout.matcher.fnmatch_lines_random(
60+
[
61+
'task_string',
62+
'task_list',
63+
'task_dict',
64+
],
65+
)
5966

6067

6168
def test_no_answer_file_dir(shell: Subprocess) -> None:

0 commit comments

Comments
 (0)