copier-python 0.19.1__tar.gz → 0.20.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- copier_python-0.20.1/AGENTS.md +30 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/CONTRIBUTING.md +12 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/PKG-INFO +8 -1
- {copier_python-0.19.1 → copier_python-0.20.1}/README.md +7 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/pyproject.toml +1 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/tests/conftest.py +18 -10
- copier_python-0.20.1/tests/template/__snapshots__/test_agents.ambr +71 -0
- copier_python-0.20.1/tests/template/__snapshots__/test_contributing.ambr +994 -0
- copier_python-0.20.1/tests/template/__snapshots__/test_pre_commit.ambr +171 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/tests/template/__snapshots__/test_pyproject.ambr +51 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/tests/template/__snapshots__/test_workflows.ambr +170 -0
- copier_python-0.20.1/tests/template/test_agents.py +21 -0
- copier_python-0.20.1/tests/template/test_commit_check.py +29 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/tests/template/test_contributing.py +12 -3
- {copier_python-0.19.1 → copier_python-0.20.1}/tests/template/test_docs.py +4 -2
- {copier_python-0.19.1 → copier_python-0.20.1}/tests/template/test_license.py +8 -4
- copier_python-0.20.1/tests/template/test_pre_commit.py +25 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/tests/template/test_pyproject.py +4 -2
- {copier_python-0.19.1 → copier_python-0.20.1}/tests/template/test_readme.py +4 -2
- {copier_python-0.19.1 → copier_python-0.20.1}/tests/template/test_structure.py +39 -4
- copier_python-0.20.1/tests/template/test_template.py +170 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/tests/utils.py +27 -12
- copier_python-0.19.1/AGENTS.md +0 -9
- copier_python-0.19.1/tests/template/__snapshots__/test_agents.ambr +0 -15
- copier_python-0.19.1/tests/template/__snapshots__/test_contributing.ambr +0 -506
- copier_python-0.19.1/tests/template/test_agents.py +0 -13
- copier_python-0.19.1/tests/template/test_template.py +0 -22
- {copier_python-0.19.1 → copier_python-0.20.1}/.gitignore +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/LICENSE +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/copier_python/__init__.py +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/copier_python/__main__.py +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/copier_python/py.typed +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/copier_python/repo.py +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/copier_python/update.py +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/docs/contributing.md +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/docs/development/requirements.md +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/docs/development/updates.md +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/docs/development/workflow.md +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/docs/index.md +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/docs/license.md +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/docs/project-creation.md +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/docs/project-development.md +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/docs/project-release.md +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/docs/project-setup.md +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/docs/project-updates.md +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/docs/releasing.md +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/docs/requirements.md +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/docs/setup.md +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/tests/__init__.py +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/tests/template/__init__.py +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/tests/template/__snapshots__/test_compose.ambr +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/tests/template/__snapshots__/test_dockerfile.ambr +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/tests/template/__snapshots__/test_docs.ambr +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/tests/template/__snapshots__/test_license.ambr +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/tests/template/__snapshots__/test_mise_toml.ambr +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/tests/template/__snapshots__/test_readme.ambr +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/tests/template/__snapshots__/test_zensical.ambr +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/tests/template/test_compose.py +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/tests/template/test_dockerfile.py +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/tests/template/test_mise_toml.py +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/tests/template/test_workflows.py +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/tests/template/test_zensical.py +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/tests/test_update.py +0 -0
- {copier_python-0.19.1 → copier_python-0.20.1}/tests/test_version.py +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Environment/Tools
|
|
2
|
+
|
|
3
|
+
* `mise` manages dev tools and tasks, including `uv` which manages Python and dependencies.
|
|
4
|
+
* Use `uv add`/`uv run python` instead of bare `pip`/`python`
|
|
5
|
+
* `mise install`: After-clone setup (install tools, dependencies, pre-commit hooks)
|
|
6
|
+
* `mise run lint`: Pre-commit hooks (via `pre-commit`-compatible `prek`) including lint, format, type check (ruff, ty)
|
|
7
|
+
* `mise run test`: Run tests (accepts pytest arguments)
|
|
8
|
+
* `mise run lt`: Lint+test (no arguments)
|
|
9
|
+
* `mise run snapup`: Update test snapshots (syrupy, accepts pytest arguments)
|
|
10
|
+
|
|
11
|
+
# Commit conventions
|
|
12
|
+
|
|
13
|
+
* Keep commit messages concise and in plain language, so a maintainer can
|
|
14
|
+
quickly understand the change. Use a short subject, and add a body only when
|
|
15
|
+
the change needs explaining, in a few lines about why. Don't list changed
|
|
16
|
+
files, restate the diff, or report test results.
|
|
17
|
+
* If a commit contains code or text largely generated by an LLM, add an
|
|
18
|
+
`Assisted-by: <tool>:<model>` trailer, for example with `git commit --trailer`.
|
|
19
|
+
* Don't add `Co-authored-by` or `Signed-off-by` lines for LLM tools, links to
|
|
20
|
+
LLM sessions, or promotional lines such as "Generated with [...]".
|
|
21
|
+
|
|
22
|
+
# Submitting contributions
|
|
23
|
+
|
|
24
|
+
* You may commit locally without asking. Before submitting anything, such as
|
|
25
|
+
pushing commits or creating or editing a pull request, issue, or comment,
|
|
26
|
+
show the user (who is the contributor) exactly what will be submitted, and
|
|
27
|
+
wait for their explicit approval. Submit it as approved. This includes but is
|
|
28
|
+
not limited to commit messages, titles, and bodies.
|
|
29
|
+
* Keep titles and descriptions short and specific. Don't restate what the diff
|
|
30
|
+
already shows.
|
|
@@ -21,3 +21,15 @@ licensed under the project's license, the
|
|
|
21
21
|
[MIT License](https://github.com/smkent/copier-python/blob/main/LICENSE),
|
|
22
22
|
with no additional terms,
|
|
23
23
|
and that you have the right to submit it under that license.
|
|
24
|
+
|
|
25
|
+
## LLM use
|
|
26
|
+
|
|
27
|
+
A contributor is always the author of their contributions.
|
|
28
|
+
You must read, review, and understand everything you submit, including
|
|
29
|
+
LLM-generated code or text, and be able to explain it on request.
|
|
30
|
+
|
|
31
|
+
If a commit contains code or text largely generated by an LLM, add an
|
|
32
|
+
`Assisted-by: <tool>:<model>` trailer to its message. This can be done
|
|
33
|
+
automatically with `git commit --trailer="Assisted-by: <tool>:<model>"`.
|
|
34
|
+
|
|
35
|
+
Do not use `Co-authored-by:` for LLM attribution. LLMs are tools, not authors.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: copier-python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.20.1
|
|
4
4
|
Summary: Copier template for Python projects with modern tooling
|
|
5
5
|
Project-URL: Homepage, https://smkent.github.io/copier-python
|
|
6
6
|
Project-URL: Repository, https://github.com/smkent/copier-python
|
|
@@ -81,6 +81,11 @@ copier copy "gh:smkent/copier-python" /new/project/path
|
|
|
81
81
|
* [**pytest**][pytest] test framework with [**codecov.io**][codecovio] support
|
|
82
82
|
* [**Zensical**][zensical] project documentation with automatic deployment to
|
|
83
83
|
[**GitHub Pages**][github-pages]
|
|
84
|
+
* Contribution terms including selectable LLM use policy, with commit message
|
|
85
|
+
checks by [**commit-check**][commit-check]
|
|
86
|
+
|
|
87
|
+
[![commit-check][commit-check-badge]][commit-check]
|
|
88
|
+
|
|
84
89
|
|
|
85
90
|
## Credits
|
|
86
91
|
|
|
@@ -96,6 +101,8 @@ Licensed under the MIT License
|
|
|
96
101
|
|
|
97
102
|
[astral]: https://astral.sh
|
|
98
103
|
[codecovio]: https://codecov.io
|
|
104
|
+
[commit-check]: https://commit-check.com
|
|
105
|
+
[commit-check-badge]: https://commit-check.com/badge.svg
|
|
99
106
|
[copier-astral]: https://ritwiktiwari.github.io/copier-astral/
|
|
100
107
|
[copier-badge]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-purple.json
|
|
101
108
|
[copier-update]: https://copier.readthedocs.io/en/stable/updating/
|
|
@@ -51,6 +51,11 @@ copier copy "gh:smkent/copier-python" /new/project/path
|
|
|
51
51
|
* [**pytest**][pytest] test framework with [**codecov.io**][codecovio] support
|
|
52
52
|
* [**Zensical**][zensical] project documentation with automatic deployment to
|
|
53
53
|
[**GitHub Pages**][github-pages]
|
|
54
|
+
* Contribution terms including selectable LLM use policy, with commit message
|
|
55
|
+
checks by [**commit-check**][commit-check]
|
|
56
|
+
|
|
57
|
+
[![commit-check][commit-check-badge]][commit-check]
|
|
58
|
+
|
|
54
59
|
|
|
55
60
|
## Credits
|
|
56
61
|
|
|
@@ -66,6 +71,8 @@ Licensed under the MIT License
|
|
|
66
71
|
|
|
67
72
|
[astral]: https://astral.sh
|
|
68
73
|
[codecovio]: https://codecov.io
|
|
74
|
+
[commit-check]: https://commit-check.com
|
|
75
|
+
[commit-check-badge]: https://commit-check.com/badge.svg
|
|
69
76
|
[copier-astral]: https://ritwiktiwari.github.io/copier-astral/
|
|
70
77
|
[copier-badge]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-purple.json
|
|
71
78
|
[copier-update]: https://copier.readthedocs.io/en/stable/updating/
|
|
@@ -2,7 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import subprocess
|
|
4
4
|
import warnings
|
|
5
|
-
from
|
|
5
|
+
from functools import partial
|
|
6
6
|
from typing import TYPE_CHECKING, Any
|
|
7
7
|
|
|
8
8
|
import copier
|
|
@@ -11,12 +11,11 @@ import yaml
|
|
|
11
11
|
|
|
12
12
|
from copier_python.__main__ import setup_env
|
|
13
13
|
|
|
14
|
-
from .utils import DisallowCallable
|
|
14
|
+
from .utils import DisallowCallable, template
|
|
15
15
|
|
|
16
16
|
if TYPE_CHECKING:
|
|
17
17
|
from collections.abc import Callable, Iterator
|
|
18
|
-
|
|
19
|
-
TEMPLATE_ROOT = Path(__file__).parent.parent
|
|
18
|
+
from pathlib import Path
|
|
20
19
|
|
|
21
20
|
DEFAULT_DATA: dict[str, Any] = {
|
|
22
21
|
"project_name": "PKFire",
|
|
@@ -38,7 +37,7 @@ def ensure_env() -> None:
|
|
|
38
37
|
setup_env()
|
|
39
38
|
|
|
40
39
|
|
|
41
|
-
@pytest.fixture(autouse=True)
|
|
40
|
+
@pytest.fixture(autouse=True, scope="session")
|
|
42
41
|
def disallow_subprocess(
|
|
43
42
|
request: pytest.FixtureRequest,
|
|
44
43
|
) -> Iterator[DisallowCallable]:
|
|
@@ -46,18 +45,19 @@ def disallow_subprocess(
|
|
|
46
45
|
yield mock
|
|
47
46
|
|
|
48
47
|
|
|
49
|
-
@pytest.fixture
|
|
48
|
+
@pytest.fixture(scope="session")
|
|
50
49
|
def allow_subprocess(disallow_subprocess: DisallowCallable) -> Iterator[None]:
|
|
51
50
|
with disallow_subprocess.pause():
|
|
52
51
|
yield
|
|
53
52
|
|
|
54
53
|
|
|
55
|
-
@pytest.fixture
|
|
56
|
-
def
|
|
57
|
-
|
|
54
|
+
@pytest.fixture(scope="session")
|
|
55
|
+
def session_render_template(
|
|
56
|
+
disallow_subprocess: DisallowCallable,
|
|
58
57
|
) -> Callable[..., Path]:
|
|
59
58
|
def _render(
|
|
60
59
|
*,
|
|
60
|
+
tmp_path: Path,
|
|
61
61
|
vcs_ref: str = "HEAD",
|
|
62
62
|
previous_answers: dict[str, Any] | None = None,
|
|
63
63
|
**kwargs: Any,
|
|
@@ -82,7 +82,7 @@ def render_template(
|
|
|
82
82
|
)
|
|
83
83
|
with disallow_subprocess.pause():
|
|
84
84
|
copier.run_copy(
|
|
85
|
-
src_path=str(
|
|
85
|
+
src_path=str(template.dir),
|
|
86
86
|
dst_path=str(worktree),
|
|
87
87
|
data=data,
|
|
88
88
|
vcs_ref=vcs_ref,
|
|
@@ -93,3 +93,11 @@ def render_template(
|
|
|
93
93
|
return worktree
|
|
94
94
|
|
|
95
95
|
return _render
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
@pytest.fixture
|
|
99
|
+
def render_template(
|
|
100
|
+
session_render_template: Callable[..., Path],
|
|
101
|
+
tmp_path: Path,
|
|
102
|
+
) -> Callable[..., Path]:
|
|
103
|
+
return partial(session_render_template, tmp_path=tmp_path)
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# serializer version: 1
|
|
2
|
+
# name: test_agents[accepted-with-disclosure]
|
|
3
|
+
'''
|
|
4
|
+
# Environment/Tools
|
|
5
|
+
|
|
6
|
+
* `mise` manages dev tools and tasks, including `uv` which manages Python and dependencies.
|
|
7
|
+
* Use `uv add`/`uv run python` instead of bare `pip`/`python`
|
|
8
|
+
* `mise install`: After-clone setup (install tools, dependencies, pre-commit hooks)
|
|
9
|
+
* `mise run lint`: Pre-commit hooks (via `pre-commit`-compatible `prek`) including lint, format, type check (ruff, ty)
|
|
10
|
+
* `mise run test`: Run tests (accepts pytest arguments)
|
|
11
|
+
* `mise run lt`: Lint+test (no arguments)
|
|
12
|
+
* `mise run snapup`: Update test snapshots (syrupy, accepts pytest arguments)
|
|
13
|
+
|
|
14
|
+
# Commit conventions
|
|
15
|
+
|
|
16
|
+
* Keep commit messages concise and in plain language, so a maintainer can
|
|
17
|
+
quickly understand the change. Use a short subject, and add a body only when
|
|
18
|
+
the change needs explaining, in a few lines about why. Don't list changed
|
|
19
|
+
files, restate the diff, or report test results.
|
|
20
|
+
* If a commit contains code or text largely generated by an LLM, add an
|
|
21
|
+
`Assisted-by: <tool>:<model>` trailer, for example with `git commit --trailer`.
|
|
22
|
+
* Don't add `Co-authored-by` or `Signed-off-by` lines for LLM tools, links to
|
|
23
|
+
LLM sessions, or promotional lines such as "Generated with [...]".
|
|
24
|
+
|
|
25
|
+
# Submitting contributions
|
|
26
|
+
|
|
27
|
+
* You may commit locally without asking. Before submitting anything, such as
|
|
28
|
+
pushing commits or creating or editing a pull request, issue, or comment,
|
|
29
|
+
show the user (who is the contributor) exactly what will be submitted, and
|
|
30
|
+
wait for their explicit approval. Submit it as approved. This includes but is
|
|
31
|
+
not limited to commit messages, titles, and bodies.
|
|
32
|
+
* Keep titles and descriptions short and specific. Don't restate what the diff
|
|
33
|
+
already shows.
|
|
34
|
+
|
|
35
|
+
'''
|
|
36
|
+
# ---
|
|
37
|
+
# name: test_agents[accepted]
|
|
38
|
+
'''
|
|
39
|
+
# Environment/Tools
|
|
40
|
+
|
|
41
|
+
* `mise` manages dev tools and tasks, including `uv` which manages Python and dependencies.
|
|
42
|
+
* Use `uv add`/`uv run python` instead of bare `pip`/`python`
|
|
43
|
+
* `mise install`: After-clone setup (install tools, dependencies, pre-commit hooks)
|
|
44
|
+
* `mise run lint`: Pre-commit hooks (via `pre-commit`-compatible `prek`) including lint, format, type check (ruff, ty)
|
|
45
|
+
* `mise run test`: Run tests (accepts pytest arguments)
|
|
46
|
+
* `mise run lt`: Lint+test (no arguments)
|
|
47
|
+
* `mise run snapup`: Update test snapshots (syrupy, accepts pytest arguments)
|
|
48
|
+
|
|
49
|
+
'''
|
|
50
|
+
# ---
|
|
51
|
+
# name: test_agents[not-accepted]
|
|
52
|
+
'''
|
|
53
|
+
# Environment/Tools
|
|
54
|
+
|
|
55
|
+
* `mise` manages dev tools and tasks, including `uv` which manages Python and dependencies.
|
|
56
|
+
* Use `uv add`/`uv run python` instead of bare `pip`/`python`
|
|
57
|
+
* `mise install`: After-clone setup (install tools, dependencies, pre-commit hooks)
|
|
58
|
+
* `mise run lint`: Pre-commit hooks (via `pre-commit`-compatible `prek`) including lint, format, type check (ruff, ty)
|
|
59
|
+
* `mise run test`: Run tests (accepts pytest arguments)
|
|
60
|
+
* `mise run lt`: Lint+test (no arguments)
|
|
61
|
+
* `mise run snapup`: Update test snapshots (syrupy, accepts pytest arguments)
|
|
62
|
+
|
|
63
|
+
# LLM use
|
|
64
|
+
|
|
65
|
+
This project does not accept code or text generated by an LLM. Everything
|
|
66
|
+
submitted to the project, including code, commit messages, and pull request or
|
|
67
|
+
issue text, must be written by the user (who is the contributor). Explain,
|
|
68
|
+
review, run commands, and help plan instead.
|
|
69
|
+
|
|
70
|
+
'''
|
|
71
|
+
# ---
|