copier-python 0.21.0__py3-none-any.whl → 0.22.0__py3-none-any.whl
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/__main__.py +6 -1
- copier_python/update.py +5 -4
- {copier_python-0.21.0.dist-info → copier_python-0.22.0.dist-info}/METADATA +1 -1
- copier_python-0.22.0.dist-info/RECORD +10 -0
- copier_python-0.21.0.dist-info/RECORD +0 -10
- {copier_python-0.21.0.dist-info → copier_python-0.22.0.dist-info}/WHEEL +0 -0
- {copier_python-0.21.0.dist-info → copier_python-0.22.0.dist-info}/entry_points.txt +0 -0
- {copier_python-0.21.0.dist-info → copier_python-0.22.0.dist-info}/licenses/LICENSE +0 -0
copier_python/__main__.py
CHANGED
|
@@ -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)
|
copier_python/update.py
CHANGED
|
@@ -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()
|
|
@@ -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
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
copier_python/__init__.py,sha256=FxuK5Dek123GsD9rxpsXCP4FjxI7unpoPYe6Mto1Rjk,289
|
|
2
|
+
copier_python/__main__.py,sha256=6flPTGOnGiXIoqzXatib9uuGLymA70BPYKWm4psBL84,3716
|
|
3
|
+
copier_python/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
copier_python/repo.py,sha256=Nv48fWeB0EZ4PGnrRWaiR6Fl5cyrD2_TwaJDcm-zNGE,5364
|
|
5
|
+
copier_python/update.py,sha256=Lr1VCoePjM3QECG7dmJynM3Rnz01bkew8f72mq0i9LE,2641
|
|
6
|
+
copier_python-0.22.0.dist-info/METADATA,sha256=pbrrPJaMTLGXFG0Lg08wpeXUFYh5p7WX2NfT8fNGtFc,5423
|
|
7
|
+
copier_python-0.22.0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
8
|
+
copier_python-0.22.0.dist-info/entry_points.txt,sha256=HjthcI_ZBjVT8uC8vjlk8m4XWpmR9_b89rpAWjzFZvo,62
|
|
9
|
+
copier_python-0.22.0.dist-info/licenses/LICENSE,sha256=lwNXeTMjiyUh8CtIKWnb2SOTeliVKCJfs_NZB6P23BE,1086
|
|
10
|
+
copier_python-0.22.0.dist-info/RECORD,,
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
copier_python/__init__.py,sha256=FxuK5Dek123GsD9rxpsXCP4FjxI7unpoPYe6Mto1Rjk,289
|
|
2
|
-
copier_python/__main__.py,sha256=EwqmzIsqoTCVuGSEGKr6hglBhSO3r4sT66uoNUpYZEA,3551
|
|
3
|
-
copier_python/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
copier_python/repo.py,sha256=Nv48fWeB0EZ4PGnrRWaiR6Fl5cyrD2_TwaJDcm-zNGE,5364
|
|
5
|
-
copier_python/update.py,sha256=-FD2FLnIbzskdj-z-wt4sWzy3GHek8i2vkEB3iMjHT8,2534
|
|
6
|
-
copier_python-0.21.0.dist-info/METADATA,sha256=GTjxD21d1ca_C9O2KFrXpNGq4HqZaghVQ6knv3ixwlg,5423
|
|
7
|
-
copier_python-0.21.0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
8
|
-
copier_python-0.21.0.dist-info/entry_points.txt,sha256=HjthcI_ZBjVT8uC8vjlk8m4XWpmR9_b89rpAWjzFZvo,62
|
|
9
|
-
copier_python-0.21.0.dist-info/licenses/LICENSE,sha256=lwNXeTMjiyUh8CtIKWnb2SOTeliVKCJfs_NZB6P23BE,1086
|
|
10
|
-
copier_python-0.21.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|