copier-python 0.13.0__py3-none-any.whl → 0.13.2__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/repo.py CHANGED
@@ -83,17 +83,33 @@ class RepoWorktree:
83
83
  with tempfile.TemporaryDirectory() as td:
84
84
  repo_dir = Path(td) / "worktree"
85
85
  cls.run_in(["git", "clone", repo.url, str(repo_dir)], repo=repo)
86
- for cmd in (
86
+ cls.run_in(
87
87
  [
88
88
  *["git", "remote", "set-url", "--push", "origin"],
89
89
  repo.push_url,
90
90
  ],
91
- ["poe", "setup"],
92
- ["git", "checkout", "-b", branch],
93
- ):
94
- cls.run_in(cmd, repo=repo, cwd=repo_dir)
91
+ repo=repo,
92
+ cwd=repo_dir,
93
+ )
94
+ cls.run_in(
95
+ (
96
+ ["mise", "install"]
97
+ if (repo_dir / "mise.toml").is_file()
98
+ else ["poe", "setup"]
99
+ ),
100
+ repo=repo,
101
+ cwd=repo_dir,
102
+ )
103
+ cls.run_in(
104
+ ["git", "checkout", "-b", branch], repo=repo, cwd=repo_dir
105
+ )
95
106
  yield cls(path=repo_dir, repo=repo, branch=branch)
96
107
 
108
+ def refresh_tools_lock(self) -> None:
109
+ if not (self.path / "mise.toml").is_file():
110
+ return
111
+ self.run(["mise", "lock"])
112
+
97
113
  @classmethod
98
114
  def run_in(
99
115
  cls, cmd: list[str], *, repo: RepoTarget, **kwargs: Any
@@ -114,6 +130,16 @@ class RepoWorktree:
114
130
  kwargs.setdefault("cwd", self.path)
115
131
  return self.run_in(cmd, repo=self.repo, **kwargs)
116
132
 
133
+ def run_task(
134
+ self, name: str, **kwargs: Any
135
+ ) -> subprocess.CompletedProcess[str]:
136
+ task_runner = (
137
+ ["mise", "run"]
138
+ if (self.path / "mise.toml").is_file()
139
+ else ["uv", "run", "poe"]
140
+ )
141
+ return self.run([*task_runner, name], **kwargs)
142
+
117
143
  def git_status(self) -> list[str]:
118
144
  return self.run(
119
145
  ["git", "status", "--porcelain"], capture_output=True
copier_python/update.py CHANGED
@@ -51,7 +51,16 @@ class UpdateAction:
51
51
  raise RuntimeError("Conflicts remain, aborting")
52
52
 
53
53
  try:
54
- repo.run(["uv", "run", "poe", "lt"])
54
+ repo.refresh_tools_lock()
55
+ except subprocess.CalledProcessError:
56
+ print( # noqa: T201
57
+ "Tool refresh failed."
58
+ " Fix errors and exit the shell to continue."
59
+ )
60
+ repo.shell()
61
+
62
+ try:
63
+ repo.run_task("lt")
55
64
  except subprocess.CalledProcessError:
56
65
  print( # noqa: T201
57
66
  "Lint/test failed. Fix errors and exit the shell to continue."
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: copier-python
3
- Version: 0.13.0
3
+ Version: 0.13.2
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=DhAwkZmfhMa40m91IgDcVIDTjjaiT1hFHrZ7AqzJdVY,3560
3
+ copier_python/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ copier_python/repo.py,sha256=e03eRst9PR2HYoRQu96mhPwBW6o7WFjOi1DXFQs5Daw,5624
5
+ copier_python/update.py,sha256=leZV4yRvCusEMKQcs80U56S8cjrSAdpO6xV5mfrKhYA,2700
6
+ copier_python-0.13.2.dist-info/METADATA,sha256=o7-LU2jesYq_v1VhPWnQC7lKxUbIPJiApFLEovXGLqI,4980
7
+ copier_python-0.13.2.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
8
+ copier_python-0.13.2.dist-info/entry_points.txt,sha256=HjthcI_ZBjVT8uC8vjlk8m4XWpmR9_b89rpAWjzFZvo,62
9
+ copier_python-0.13.2.dist-info/licenses/LICENSE,sha256=UHHRyYuAwaR1EBittWk49EmWR0c7MIIMBXt_L_auZtQ,1069
10
+ copier_python-0.13.2.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- copier_python/__init__.py,sha256=FxuK5Dek123GsD9rxpsXCP4FjxI7unpoPYe6Mto1Rjk,289
2
- copier_python/__main__.py,sha256=DhAwkZmfhMa40m91IgDcVIDTjjaiT1hFHrZ7AqzJdVY,3560
3
- copier_python/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- copier_python/repo.py,sha256=_gZaTNsAabSik4J7O5H3W6AzvudL2OO_B_1q1owo-Ms,4869
5
- copier_python/update.py,sha256=rhAvcUw09GL1DbAUay9VBN6saYcGPok4zajbJQXYkRw,2446
6
- copier_python-0.13.0.dist-info/METADATA,sha256=yJyUl1ad2B4aFW_I-tA_Q6iEJ8Tx_U4AfdZwFII6h8M,4980
7
- copier_python-0.13.0.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
8
- copier_python-0.13.0.dist-info/entry_points.txt,sha256=HjthcI_ZBjVT8uC8vjlk8m4XWpmR9_b89rpAWjzFZvo,62
9
- copier_python-0.13.0.dist-info/licenses/LICENSE,sha256=UHHRyYuAwaR1EBittWk49EmWR0c7MIIMBXt_L_auZtQ,1069
10
- copier_python-0.13.0.dist-info/RECORD,,