copier-python 0.21.0__tar.gz → 0.22.0__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.21.0 → copier_python-0.22.0}/PKG-INFO +1 -1
- {copier_python-0.21.0 → copier_python-0.22.0}/copier_python/__main__.py +6 -1
- {copier_python-0.21.0 → copier_python-0.22.0}/copier_python/update.py +5 -4
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/test_update.py +8 -2
- {copier_python-0.21.0 → copier_python-0.22.0}/.gitignore +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/AGENTS.md +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/CONTRIBUTING.md +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/LICENSE +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/README.md +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/copier_python/__init__.py +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/copier_python/py.typed +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/copier_python/repo.py +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/docs/contributing.md +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/docs/development/requirements.md +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/docs/development/updates.md +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/docs/development/workflow.md +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/docs/index.md +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/docs/license.md +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/docs/project-creation.md +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/docs/project-development.md +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/docs/project-release.md +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/docs/project-setup.md +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/docs/project-updates.md +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/docs/releasing.md +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/docs/requirements.md +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/docs/setup.md +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/pyproject.toml +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/__init__.py +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/conftest.py +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/template/__init__.py +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/template/__snapshots__/test_agents.ambr +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/template/__snapshots__/test_compose.ambr +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/template/__snapshots__/test_contributing.ambr +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/template/__snapshots__/test_dockerfile.ambr +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/template/__snapshots__/test_docs.ambr +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/template/__snapshots__/test_license.ambr +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/template/__snapshots__/test_mise_toml.ambr +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/template/__snapshots__/test_pre_commit.ambr +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/template/__snapshots__/test_pyproject.ambr +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/template/__snapshots__/test_readme.ambr +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/template/__snapshots__/test_workflows.ambr +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/template/__snapshots__/test_zensical.ambr +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/template/test_agents.py +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/template/test_commit_check.py +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/template/test_compose.py +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/template/test_contributing.py +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/template/test_dockerfile.py +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/template/test_docs.py +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/template/test_license.py +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/template/test_mise_toml.py +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/template/test_pre_commit.py +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/template/test_pyproject.py +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/template/test_readme.py +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/template/test_structure.py +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/template/test_template.py +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/template/test_workflows.py +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/template/test_zensical.py +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/test_version.py +0 -0
- {copier_python-0.21.0 → copier_python-0.22.0}/tests/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: copier-python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.22.0
|
|
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
|
|
@@ -73,6 +73,9 @@ class UpdateResult:
|
|
|
73
73
|
def update(
|
|
74
74
|
repos: Args.Repos,
|
|
75
75
|
*,
|
|
76
|
+
vcs_ref: Annotated[
|
|
77
|
+
str | None, Option("--vcs-ref", "-r", help="Template ref to update to")
|
|
78
|
+
] = None,
|
|
76
79
|
dry_run: Args.DryRun = False,
|
|
77
80
|
branch: Annotated[str, Option(help="Branch name to create.")] = "updates",
|
|
78
81
|
) -> None:
|
|
@@ -82,7 +85,9 @@ def update(
|
|
|
82
85
|
repo_targets = {(target := RepoTarget(repo)).url: target for repo in repos}
|
|
83
86
|
for target in repo_targets.values():
|
|
84
87
|
try:
|
|
85
|
-
pr_url = UpdateAction(
|
|
88
|
+
pr_url = UpdateAction(
|
|
89
|
+
target, branch=branch, vcs_ref=vcs_ref, dry_run=dry_run
|
|
90
|
+
)()
|
|
86
91
|
if pr_url:
|
|
87
92
|
results.append(
|
|
88
93
|
UpdateResult(target, UpdateStatus.UPDATED, pr_url=pr_url)
|
|
@@ -3,7 +3,7 @@ from __future__ import annotations
|
|
|
3
3
|
import json
|
|
4
4
|
import os
|
|
5
5
|
import subprocess
|
|
6
|
-
from dataclasses import dataclass
|
|
6
|
+
from dataclasses import dataclass, field
|
|
7
7
|
from typing import TYPE_CHECKING
|
|
8
8
|
|
|
9
9
|
from .repo import RepoWorktree
|
|
@@ -18,7 +18,8 @@ TEMPLATE_REPO_URL = "https://github.com/smkent/copier-python"
|
|
|
18
18
|
class UpdateAction:
|
|
19
19
|
repo: RepoTarget
|
|
20
20
|
branch: str
|
|
21
|
-
|
|
21
|
+
vcs_ref: str | None = None
|
|
22
|
+
dry_run: bool = field(default=False, kw_only=True)
|
|
22
23
|
|
|
23
24
|
def __call__(self) -> str | None:
|
|
24
25
|
with RepoWorktree.clone(self.repo, branch=self.branch) as worktree:
|
|
@@ -33,10 +34,10 @@ class UpdateAction:
|
|
|
33
34
|
).stdout.strip()
|
|
34
35
|
)
|
|
35
36
|
start_ref = "v" + copier_status["current_version"]
|
|
36
|
-
end_ref = "v" + copier_status["latest_version"]
|
|
37
|
+
end_ref = self.vcs_ref or ("v" + copier_status["latest_version"])
|
|
37
38
|
if not copier_status.get("update_available", False):
|
|
38
39
|
return None
|
|
39
|
-
repo.run(["copier", "update", "--skip-answered"])
|
|
40
|
+
repo.run(["copier", "update", "--skip-answered", "--vcs-ref", end_ref])
|
|
40
41
|
repo.run(["mise", "install"])
|
|
41
42
|
|
|
42
43
|
status = repo.git_status()
|
|
@@ -312,7 +312,10 @@ def test_main_update_error(
|
|
|
312
312
|
cwd=worktree,
|
|
313
313
|
capture_output=True,
|
|
314
314
|
)
|
|
315
|
-
expect_run.expect(
|
|
315
|
+
expect_run.expect(
|
|
316
|
+
["copier", "update", "--skip-answered", "--vcs-ref", end_ref],
|
|
317
|
+
cwd=worktree,
|
|
318
|
+
)
|
|
316
319
|
expect_run.expect(["mise", "install"], cwd=worktree)
|
|
317
320
|
expect_run.expect(
|
|
318
321
|
["git", "status", "--porcelain"], cwd=worktree, capture_output=True
|
|
@@ -400,7 +403,10 @@ def test_main_update_with_project(
|
|
|
400
403
|
cwd=worktree,
|
|
401
404
|
capture_output=True,
|
|
402
405
|
)
|
|
403
|
-
expect_run.expect(
|
|
406
|
+
expect_run.expect(
|
|
407
|
+
["copier", "update", "--skip-answered", "--vcs-ref", end_ref],
|
|
408
|
+
cwd=worktree,
|
|
409
|
+
)
|
|
404
410
|
expect_run.expect(["mise", "install"], cwd=worktree)
|
|
405
411
|
expect_run.expect(
|
|
406
412
|
["git", "status", "--porcelain"], cwd=worktree, capture_output=True
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{copier_python-0.21.0 → copier_python-0.22.0}/tests/template/__snapshots__/test_compose.ambr
RENAMED
|
File without changes
|
{copier_python-0.21.0 → copier_python-0.22.0}/tests/template/__snapshots__/test_contributing.ambr
RENAMED
|
File without changes
|
{copier_python-0.21.0 → copier_python-0.22.0}/tests/template/__snapshots__/test_dockerfile.ambr
RENAMED
|
File without changes
|
|
File without changes
|
{copier_python-0.21.0 → copier_python-0.22.0}/tests/template/__snapshots__/test_license.ambr
RENAMED
|
File without changes
|
{copier_python-0.21.0 → copier_python-0.22.0}/tests/template/__snapshots__/test_mise_toml.ambr
RENAMED
|
File without changes
|
{copier_python-0.21.0 → copier_python-0.22.0}/tests/template/__snapshots__/test_pre_commit.ambr
RENAMED
|
File without changes
|
{copier_python-0.21.0 → copier_python-0.22.0}/tests/template/__snapshots__/test_pyproject.ambr
RENAMED
|
File without changes
|
|
File without changes
|
{copier_python-0.21.0 → copier_python-0.22.0}/tests/template/__snapshots__/test_workflows.ambr
RENAMED
|
File without changes
|
{copier_python-0.21.0 → copier_python-0.22.0}/tests/template/__snapshots__/test_zensical.ambr
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|