copier-python 0.23.0__tar.gz → 0.23.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.
Files changed (59) hide show
  1. {copier_python-0.23.0 → copier_python-0.23.1}/PKG-INFO +1 -1
  2. {copier_python-0.23.0 → copier_python-0.23.1}/copier_python/update.py +18 -7
  3. {copier_python-0.23.0 → copier_python-0.23.1}/.gitignore +0 -0
  4. {copier_python-0.23.0 → copier_python-0.23.1}/AGENTS.md +0 -0
  5. {copier_python-0.23.0 → copier_python-0.23.1}/CONTRIBUTING.md +0 -0
  6. {copier_python-0.23.0 → copier_python-0.23.1}/LICENSE +0 -0
  7. {copier_python-0.23.0 → copier_python-0.23.1}/README.md +0 -0
  8. {copier_python-0.23.0 → copier_python-0.23.1}/copier_python/__init__.py +0 -0
  9. {copier_python-0.23.0 → copier_python-0.23.1}/copier_python/__main__.py +0 -0
  10. {copier_python-0.23.0 → copier_python-0.23.1}/copier_python/py.typed +0 -0
  11. {copier_python-0.23.0 → copier_python-0.23.1}/copier_python/repo.py +0 -0
  12. {copier_python-0.23.0 → copier_python-0.23.1}/docs/contributing.md +0 -0
  13. {copier_python-0.23.0 → copier_python-0.23.1}/docs/development/requirements.md +0 -0
  14. {copier_python-0.23.0 → copier_python-0.23.1}/docs/development/updates.md +0 -0
  15. {copier_python-0.23.0 → copier_python-0.23.1}/docs/development/workflow.md +0 -0
  16. {copier_python-0.23.0 → copier_python-0.23.1}/docs/index.md +0 -0
  17. {copier_python-0.23.0 → copier_python-0.23.1}/docs/license.md +0 -0
  18. {copier_python-0.23.0 → copier_python-0.23.1}/docs/project-creation.md +0 -0
  19. {copier_python-0.23.0 → copier_python-0.23.1}/docs/project-development.md +0 -0
  20. {copier_python-0.23.0 → copier_python-0.23.1}/docs/project-release.md +0 -0
  21. {copier_python-0.23.0 → copier_python-0.23.1}/docs/project-setup.md +0 -0
  22. {copier_python-0.23.0 → copier_python-0.23.1}/docs/project-updates.md +0 -0
  23. {copier_python-0.23.0 → copier_python-0.23.1}/docs/releasing.md +0 -0
  24. {copier_python-0.23.0 → copier_python-0.23.1}/docs/requirements.md +0 -0
  25. {copier_python-0.23.0 → copier_python-0.23.1}/docs/setup.md +0 -0
  26. {copier_python-0.23.0 → copier_python-0.23.1}/pyproject.toml +0 -0
  27. {copier_python-0.23.0 → copier_python-0.23.1}/tests/__init__.py +0 -0
  28. {copier_python-0.23.0 → copier_python-0.23.1}/tests/conftest.py +0 -0
  29. {copier_python-0.23.0 → copier_python-0.23.1}/tests/template/__init__.py +0 -0
  30. {copier_python-0.23.0 → copier_python-0.23.1}/tests/template/__snapshots__/test_agents.ambr +0 -0
  31. {copier_python-0.23.0 → copier_python-0.23.1}/tests/template/__snapshots__/test_compose.ambr +0 -0
  32. {copier_python-0.23.0 → copier_python-0.23.1}/tests/template/__snapshots__/test_contributing.ambr +0 -0
  33. {copier_python-0.23.0 → copier_python-0.23.1}/tests/template/__snapshots__/test_dockerfile.ambr +0 -0
  34. {copier_python-0.23.0 → copier_python-0.23.1}/tests/template/__snapshots__/test_docs.ambr +0 -0
  35. {copier_python-0.23.0 → copier_python-0.23.1}/tests/template/__snapshots__/test_license.ambr +0 -0
  36. {copier_python-0.23.0 → copier_python-0.23.1}/tests/template/__snapshots__/test_mise_toml.ambr +0 -0
  37. {copier_python-0.23.0 → copier_python-0.23.1}/tests/template/__snapshots__/test_pre_commit.ambr +0 -0
  38. {copier_python-0.23.0 → copier_python-0.23.1}/tests/template/__snapshots__/test_pyproject.ambr +0 -0
  39. {copier_python-0.23.0 → copier_python-0.23.1}/tests/template/__snapshots__/test_readme.ambr +0 -0
  40. {copier_python-0.23.0 → copier_python-0.23.1}/tests/template/__snapshots__/test_workflows.ambr +0 -0
  41. {copier_python-0.23.0 → copier_python-0.23.1}/tests/template/__snapshots__/test_zensical.ambr +0 -0
  42. {copier_python-0.23.0 → copier_python-0.23.1}/tests/template/test_agents.py +0 -0
  43. {copier_python-0.23.0 → copier_python-0.23.1}/tests/template/test_commit_check.py +0 -0
  44. {copier_python-0.23.0 → copier_python-0.23.1}/tests/template/test_compose.py +0 -0
  45. {copier_python-0.23.0 → copier_python-0.23.1}/tests/template/test_contributing.py +0 -0
  46. {copier_python-0.23.0 → copier_python-0.23.1}/tests/template/test_dockerfile.py +0 -0
  47. {copier_python-0.23.0 → copier_python-0.23.1}/tests/template/test_docs.py +0 -0
  48. {copier_python-0.23.0 → copier_python-0.23.1}/tests/template/test_license.py +0 -0
  49. {copier_python-0.23.0 → copier_python-0.23.1}/tests/template/test_mise_toml.py +0 -0
  50. {copier_python-0.23.0 → copier_python-0.23.1}/tests/template/test_pre_commit.py +0 -0
  51. {copier_python-0.23.0 → copier_python-0.23.1}/tests/template/test_pyproject.py +0 -0
  52. {copier_python-0.23.0 → copier_python-0.23.1}/tests/template/test_readme.py +0 -0
  53. {copier_python-0.23.0 → copier_python-0.23.1}/tests/template/test_structure.py +0 -0
  54. {copier_python-0.23.0 → copier_python-0.23.1}/tests/template/test_template.py +0 -0
  55. {copier_python-0.23.0 → copier_python-0.23.1}/tests/template/test_workflows.py +0 -0
  56. {copier_python-0.23.0 → copier_python-0.23.1}/tests/template/test_zensical.py +0 -0
  57. {copier_python-0.23.0 → copier_python-0.23.1}/tests/test_update.py +2 -2
  58. {copier_python-0.23.0 → copier_python-0.23.1}/tests/test_version.py +0 -0
  59. {copier_python-0.23.0 → copier_python-0.23.1}/tests/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: copier-python
3
- Version: 0.23.0
3
+ Version: 0.23.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
@@ -3,12 +3,15 @@ from __future__ import annotations
3
3
  import json
4
4
  import os
5
5
  import subprocess
6
+ from contextlib import contextmanager
6
7
  from dataclasses import dataclass, field
7
8
  from typing import TYPE_CHECKING
8
9
 
9
10
  from .repo import RepoWorktree
10
11
 
11
12
  if TYPE_CHECKING:
13
+ from collections.abc import Generator
14
+
12
15
  from .repo import RepoTarget
13
16
 
14
17
  TEMPLATE_REPO_URL = "https://github.com/smkent/copier-python"
@@ -25,6 +28,18 @@ class UpdateAction:
25
28
  with RepoWorktree.clone(self.repo, branch=self.branch) as worktree:
26
29
  return self._run(worktree)
27
30
 
31
+ @contextmanager
32
+ def _success_or_shell(
33
+ self, repo: RepoWorktree, name: str
34
+ ) -> Generator[None]:
35
+ try:
36
+ yield
37
+ except subprocess.CalledProcessError:
38
+ print( # noqa: T201
39
+ f"{name} failed. Fix errors and exit the shell to continue."
40
+ )
41
+ repo.shell()
42
+
28
43
  def _run(self, repo: RepoWorktree) -> str | None:
29
44
  """Run copier update in the repo worktree."""
30
45
  copier_status = json.loads(
@@ -38,7 +53,6 @@ class UpdateAction:
38
53
  if not copier_status.get("update_available", False):
39
54
  return None
40
55
  repo.run(["copier", "update", "--skip-answered", "--vcs-ref", end_ref])
41
- repo.run(["mise", "install"])
42
56
 
43
57
  status = repo.git_status()
44
58
  if not status:
@@ -54,13 +68,10 @@ class UpdateAction:
54
68
  if repo.has_conflicts(status):
55
69
  raise RuntimeError("Conflicts remain, aborting")
56
70
 
57
- try:
71
+ with self._success_or_shell(repo, "`mise install`"):
72
+ repo.run(["mise", "install"])
73
+ with self._success_or_shell(repo, "Lint/test"):
58
74
  repo.run_task("lt")
59
- except subprocess.CalledProcessError:
60
- print( # noqa: T201
61
- "Lint/test failed. Fix errors and exit the shell to continue."
62
- )
63
- repo.shell()
64
75
 
65
76
  title = "Apply template updates"
66
77
  body = ""
File without changes
File without changes
File without changes
@@ -316,7 +316,6 @@ def test_main_update_error(
316
316
  ["copier", "update", "--skip-answered", "--vcs-ref", end_ref],
317
317
  cwd=worktree,
318
318
  )
319
- expect_run.expect(["mise", "install"], cwd=worktree)
320
319
  expect_run.expect(
321
320
  ["git", "status", "--porcelain"], cwd=worktree, capture_output=True
322
321
  )
@@ -324,6 +323,7 @@ def test_main_update_error(
324
323
  expect_run.expect(
325
324
  ["git", "status", "--porcelain"], cwd=worktree, capture_output=True
326
325
  )
326
+ expect_run.expect(["mise", "install"], cwd=worktree)
327
327
  expect_run.expect(["mise", "run", "lt"], cwd=worktree)
328
328
  expect_run.expect([str(mock_shell)], cwd=worktree)
329
329
  for cmd in [
@@ -407,10 +407,10 @@ def test_main_update_with_project(
407
407
  ["copier", "update", "--skip-answered", "--vcs-ref", end_ref],
408
408
  cwd=worktree,
409
409
  )
410
- expect_run.expect(["mise", "install"], cwd=worktree)
411
410
  expect_run.expect(
412
411
  ["git", "status", "--porcelain"], cwd=worktree, capture_output=True
413
412
  )
413
+ expect_run.expect(["mise", "install"], cwd=worktree)
414
414
  for cmd in [
415
415
  [*["mise", "run", "lt"]],
416
416
  [*["git", "add", "-A"]],