Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions copier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,16 @@ enable_docs:
help: Enable documentation site (Zensical{% if project_visibility == 'public' %} with deployment to GitHub Pages{% endif %})?
default: yes

enable_features:
type: str
qmark: 🧩
help: Enable miscellaneous features?
multiselect: true
choices:
pytest-syrupy for snapshots: syrupy
pytest-xdist for multiprocessing: xdist
default: '["syrupy", "xdist"]'

user_name:
type: str
qmark: 🧑
Expand Down
11 changes: 11 additions & 0 deletions includes/docs.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ The `lint` and `test` tasks can also be run as a single combined command with:
```sh
poe lt
```
{%- if "syrupy" in enable_features %}

### Test snapshots

Some tests compare test results with saved snapshots. Test snapshots can be
updated by running:

```sh
poe snapup
```
{%- endif %}
{%- if enable_docs %}

{{h}}## Documentation server
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ dev = [
"pytest-cov>=7",
"pytest-sugar>=1",
"pytest-xdist>=3",
"syrupy>=5",
"ruff>=0.15",
"syrupy>=5",
"ty>=0.0.37",
]
docs = [
Expand Down Expand Up @@ -132,7 +132,7 @@ sequence = [
help = "Install project dependencies and git hooks"

[tool.poe.tasks.snapup]
cmd = "pytest --snapshot-update"
cmd = "pytest --snapshot-update --numprocesses 0"
help = "Update test snapshots"

[tool.poe.tasks.test]
Expand Down Expand Up @@ -169,7 +169,7 @@ executor = {isolated = true, python = "3.14"}
help = "Run tests using Python 3.14"

[tool.poe.tasks.ti]
cmd = "pytest -n 0 --no-cov -v"
cmd = "pytest --numprocesses 0 --no-cov -v"
help = "Run tests with debug friendly options"

[tool.pytest]
Expand All @@ -178,7 +178,7 @@ addopts = [
"--cov=copier_python",
"--strict-config",
"--strict-markers",
"-n",
"--numprocesses",
"auto",
]
testpaths = ["tests"]
Expand Down
17 changes: 15 additions & 2 deletions template/pyproject.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,13 @@ dev = [
"pytest>=9",
"pytest-cov>=7",
"pytest-sugar>=1",
{%- if "xdist" in enable_features %}
"pytest-xdist>=3",
{%- endif %}
"ruff>=0.15",
{%- if "syrupy" in enable_features %}
"syrupy>=5",
{%- endif %}
"ty>=0.0.37",
]
{%- if enable_docs %}
Expand Down Expand Up @@ -144,6 +149,12 @@ sequence = [
{cmd = "prek install"},
]
help = "Install project dependencies and git hooks"
{%- if "syrupy" in enable_features %}

[tool.poe.tasks.snapup]
cmd = "pytest --snapshot-update{% if "xdist" in enable_features %} --numprocesses 0{% endif %}"
help = "Update test snapshots"
{%- endif %}

[tool.poe.tasks.test]
cmd = "pytest"
Expand All @@ -163,7 +174,7 @@ executor = {isolated = true, python = "{{ v }}"}
help = "Run tests using Python {{ v }}"
{% endcall %}
[tool.poe.tasks.ti]
cmd = "pytest -n 0 --no-cov -v"
cmd = "pytest --numprocesses 0 --no-cov -v"
help = "Run tests with debug friendly options"

[tool.pytest]
Expand All @@ -172,8 +183,10 @@ addopts = [
"--cov={{ project_slug }}",
"--strict-config",
"--strict-markers",
"-n",
{%- if "xdist" in enable_features %}
"--numprocesses",
"auto",
{%- endif %}
]
testpaths = ["tests"]

Expand Down
9 changes: 9 additions & 0 deletions tests/__snapshots__/test_contributing.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@
poe lt
```

### Test snapshots

Some tests compare test results with saved snapshots. Test snapshots can be
updated by running:

```sh
poe snapup
```

### Applying copier-python template updates

Copier can update your project with template changes that have occurred since
Expand Down
Loading
Loading