copier-python 0.12.0__py3-none-any.whl → 0.13.1__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
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: copier-python
3
- Version: 0.12.0
3
+ Version: 0.13.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
@@ -40,8 +40,13 @@ Description-Content-Type: text/markdown
40
40
 
41
41
  ## Quick start
42
42
 
43
- With [Astral's **uv**][uv] and [**Copier**][copier] (`uv tool install copier`)
44
- installed:
43
+ Install required software:
44
+
45
+ - [**mise-en-place**][mise]: `curl https://mise.run | sh` or
46
+ [alternate installation method][mise-installation]
47
+ - [**Copier**][copier]: `mise use -g copier` or `uv tool install copier`
48
+
49
+ Create a new project from the template:
45
50
 
46
51
  ```sh
47
52
  copier copy "gh:smkent/copier-python" /new/project/path
@@ -51,6 +56,10 @@ copier copy "gh:smkent/copier-python" /new/project/path
51
56
 
52
57
  ## Features
53
58
 
59
+ * [**mise-en-place**][mise] ("mise") for development toolchain management
60
+
61
+ [![mise][mise-badge]][mise]
62
+
54
63
  * [Astral][astral] toolset: [**uv**][uv], [**ruff**][ruff], and [**ty**][ty]
55
64
 
56
65
  [![uv][uv-badge]][uv]
@@ -72,8 +81,6 @@ copier copy "gh:smkent/copier-python" /new/project/path
72
81
  * [**pytest**][pytest] test framework with [**codecov.io**][codecovio] support
73
82
  * [**Zensical**][zensical] project documentation with automatic deployment to
74
83
  [**GitHub Pages**][github-pages]
75
- * [**Poe the Poet**][poethepoet] for task shortcuts such as
76
- `poe lint`, `poe test`
77
84
 
78
85
  ## Credits
79
86
 
@@ -91,7 +98,9 @@ This template was inspired by [pawamoy/copier-uv][copier-uv] and
91
98
  [ghcr-docs]: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry
92
99
  [github-actions]: https://github.com/features/actions
93
100
  [github-pages]: https://pages.github.com
94
- [poethepoet]: https://poethepoet.natn.io/
101
+ [mise]: https://mise.jdx.dev
102
+ [mise-installation]: https://mise.jdx.dev/installing-mise.html
103
+ [mise-badge]: https://mise-versions.jdx.dev/badge.svg
95
104
  [pre-commit]: https://pre-commit.com/
96
105
  [prek-badge]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/j178/prek/master/docs/assets/badge-v0.json
97
106
  [prek]: https://prek.j178.dev/
@@ -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.1.dist-info/METADATA,sha256=eGriPKWx-7-veztCahH3ACvXXtnJzRGhuwmh35j0u_4,4980
7
+ copier_python-0.13.1.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
8
+ copier_python-0.13.1.dist-info/entry_points.txt,sha256=HjthcI_ZBjVT8uC8vjlk8m4XWpmR9_b89rpAWjzFZvo,62
9
+ copier_python-0.13.1.dist-info/licenses/LICENSE,sha256=UHHRyYuAwaR1EBittWk49EmWR0c7MIIMBXt_L_auZtQ,1069
10
+ copier_python-0.13.1.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.31.0
2
+ Generator: hatchling 1.32.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -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.12.0.dist-info/METADATA,sha256=aG_J-5HN4rSB55-rM273E9csvJn6an3AmVGHd0Ov-v0,4688
7
- copier_python-0.12.0.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
8
- copier_python-0.12.0.dist-info/entry_points.txt,sha256=HjthcI_ZBjVT8uC8vjlk8m4XWpmR9_b89rpAWjzFZvo,62
9
- copier_python-0.12.0.dist-info/licenses/LICENSE,sha256=UHHRyYuAwaR1EBittWk49EmWR0c7MIIMBXt_L_auZtQ,1069
10
- copier_python-0.12.0.dist-info/RECORD,,