create-pyproj 2.1.1__tar.gz → 2.2.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.
Files changed (64) hide show
  1. {create_pyproj-2.1.1/src/create_pyproj.egg-info → create_pyproj-2.2.0}/PKG-INFO +23 -10
  2. create_pyproj-2.1.1/PKG-INFO → create_pyproj-2.2.0/README.md +19 -14
  3. create_pyproj-2.2.0/pyproject.toml +91 -0
  4. create_pyproj-2.1.1/pyproject.toml → create_pyproj-2.2.0/pyproject.toml.orig +15 -16
  5. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/__init__.py +1 -1
  6. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/main.py +6 -3
  7. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/scaffold.py +4 -1
  8. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/base/.pre-commit-config.yaml.tmpl +1 -1
  9. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/base/AGENTS.md.tmpl +1 -0
  10. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/base/mise.toml.tmpl +7 -7
  11. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/base/pyproject.toml.tmpl +17 -25
  12. create_pyproj-2.2.0/src/create_pyproj/templates/base/renovate.json.tmpl +52 -0
  13. create_pyproj-2.2.0/src/create_pyproj/templates/base/test/test_package.py.tmpl +17 -0
  14. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/ci/github/.github/workflows/ci.yml.tmpl +12 -11
  15. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/ci/gitlab/.gitlab-ci.yml.tmpl +4 -1
  16. create_pyproj-2.2.0/src/create_pyproj/templates/interfaces/cli/test/test_cli.py.tmpl +26 -0
  17. create_pyproj-2.2.0/src/create_pyproj/templates/interfaces/web/test/test_web.py.tmpl +66 -0
  18. create_pyproj-2.2.0/src/create_pyproj/versions.py +68 -0
  19. create_pyproj-2.1.1/LICENSE +0 -21
  20. create_pyproj-2.1.1/MANIFEST.in +0 -7
  21. create_pyproj-2.1.1/readme.md +0 -101
  22. create_pyproj-2.1.1/setup.cfg +0 -4
  23. create_pyproj-2.1.1/src/create_pyproj.egg-info/SOURCES.txt +0 -56
  24. create_pyproj-2.1.1/src/create_pyproj.egg-info/dependency_links.txt +0 -1
  25. create_pyproj-2.1.1/src/create_pyproj.egg-info/entry_points.txt +0 -2
  26. create_pyproj-2.1.1/src/create_pyproj.egg-info/requires.txt +0 -1
  27. create_pyproj-2.1.1/src/create_pyproj.egg-info/top_level.txt +0 -1
  28. create_pyproj-2.1.1/test/test_main.py +0 -387
  29. create_pyproj-2.1.1/test/test_packaging.py +0 -85
  30. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templater.py +0 -0
  31. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/base/.env.example.tmpl +0 -0
  32. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/base/.gitignore.tmpl +0 -0
  33. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/base/.python-version.tmpl +0 -0
  34. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/base/.vscode/extensions.json.tmpl +0 -0
  35. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/base/.vscode/settings.json.tmpl +0 -0
  36. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/base/README.md.tmpl +0 -0
  37. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/base/docs/api.md.tmpl +0 -0
  38. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/base/docs/approach.md.tmpl +0 -0
  39. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/base/docs/data-models.md.tmpl +0 -0
  40. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/base/docs/domain-map.yml.tmpl +0 -0
  41. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/base/docs/domain-model.md.tmpl +0 -0
  42. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/base/docs/implementation.md.tmpl +0 -0
  43. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/base/docs/index.md.tmpl +0 -0
  44. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/base/docs/references.md.tmpl +0 -0
  45. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/base/docs/topology.md.tmpl +0 -0
  46. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/base/docs/use-cases.md.tmpl +0 -0
  47. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/base/mkdocs.yml.tmpl +0 -0
  48. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/base/src/${package_name}/__init__.py.tmpl +0 -0
  49. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/base/src/${package_name}/application/__init__.py.tmpl +0 -0
  50. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/base/src/${package_name}/domain/__init__.py.tmpl +0 -0
  51. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/base/src/${package_name}/infrastructure/__init__.py.tmpl +0 -0
  52. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/infra/terraform/terraform/README.md.tmpl +0 -0
  53. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/infra/terraform/terraform/_config.tf.tmpl +0 -0
  54. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/infra/terraform/terraform/main.tf.tmpl +0 -0
  55. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/infra/terraform/terraform/outputs.tf.tmpl +0 -0
  56. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/infra/terraform/terraform/variables.tf.tmpl +0 -0
  57. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/interfaces/cli/src/${package_name}/cli.py.tmpl +0 -0
  58. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/interfaces/cli/src/main.py.tmpl +0 -0
  59. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/interfaces/web/src/${package_name}/ui/__init__.py.tmpl +0 -0
  60. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/interfaces/web/src/${package_name}/ui/static/app.css +0 -0
  61. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/interfaces/web/src/${package_name}/ui/templates/_greeting.html.tmpl +0 -0
  62. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/interfaces/web/src/${package_name}/ui/templates/base.html.tmpl +0 -0
  63. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/interfaces/web/src/${package_name}/ui/templates/index.html.tmpl +0 -0
  64. {create_pyproj-2.1.1 → create_pyproj-2.2.0}/src/create_pyproj/templates/interfaces/web/src/${package_name}/web.py.tmpl +0 -0
@@ -1,12 +1,10 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.3
2
2
  Name: create-pyproj
3
- Version: 2.1.1
3
+ Version: 2.2.0
4
4
  Summary: Scaffold uv-first Python projects with a DDD and hexagonal baseline.
5
- Requires-Python: >=3.10
6
- Description-Content-Type: text/markdown
7
- License-File: LICENSE
8
5
  Requires-Dist: mako>=1.3.5
9
- Dynamic: license-file
6
+ Requires-Python: >=3.11
7
+ Description-Content-Type: text/markdown
10
8
 
11
9
  # create-pyproj
12
10
 
@@ -20,13 +18,15 @@ engineering skills.
20
18
  The default scaffold includes:
21
19
 
22
20
  - `.python-version`
23
- - `pyproject.toml` with `uv`-friendly dependency groups and Ruff configuration
24
- - `mise.toml` with tool pins and common tasks
21
+ - `pyproject.toml` built with `uv_build`, with `uv`-friendly dependency groups and Ruff configuration
22
+ - `mise.toml` with pinned tools and common tasks; it is the one source for the Python and uv versions, locally and in GitHub CI
25
23
  - semantic-release configuration for version stamping in `pyproject.toml` and `src/<package>/__init__.py`
26
24
  - `src/<package>` with `domain`, `application`, and `infrastructure` package structure
27
25
  - `docs/` plus `mkdocs.yml`
28
26
  - `AGENTS.md`
29
27
  - `.vscode/`, `.pre-commit-config.yaml`, and `.env.example`
28
+ - `test/` with starter tests for each generated adapter
29
+ - `renovate.json` so Renovate keeps dependencies, tools and hooks current
30
30
 
31
31
  Optional adapters:
32
32
 
@@ -59,7 +59,7 @@ uv tool install --force .
59
59
 
60
60
  Common flags:
61
61
 
62
- - `--python-version 3.12`
62
+ - `--python-version 3.15` (default: `PYTHON_DEFAULT` in `src/create_pyproj/versions.py`)
63
63
  - `--description "Short project summary"`
64
64
  - `--author "Your Name"`
65
65
  - `--author-email "you@example.com"`
@@ -95,11 +95,24 @@ mise run complexity
95
95
  mise run typecheck
96
96
  mise run format
97
97
  mise run test
98
+ mise run test-e2e
98
99
  uv run python -m create_pyproj.main --help
99
100
  ```
100
101
 
101
102
  The local test suite verifies the emitted scaffold contract rather than just
102
- individual template files.
103
+ individual template files. `mise run test-e2e` generates a project with every
104
+ option and runs its own gates; it needs the network.
105
+
106
+ ## Keeping Versions Current
107
+
108
+ - `src/create_pyproj/versions.py` holds every version the scaffold emits.
109
+ Templates and the CLI read from it.
110
+ - Renovate (`renovate.json`) updates that file and this repo's own pins, one
111
+ PR per dependency. Minor and patch updates automerge when CI passes.
112
+ - `test/test_versions.py` fails when this repo's pins drift from the scaffold's.
113
+ - The `Freshness` workflow runs weekly: the scaffolder and a generated project
114
+ against the newest packages, on the default Python and the next one.
115
+ - The default Python minor moves by hand under the policy in `AGENTS.md`.
103
116
 
104
117
  ## Docs
105
118
 
@@ -1,13 +1,3 @@
1
- Metadata-Version: 2.4
2
- Name: create-pyproj
3
- Version: 2.1.1
4
- Summary: Scaffold uv-first Python projects with a DDD and hexagonal baseline.
5
- Requires-Python: >=3.10
6
- Description-Content-Type: text/markdown
7
- License-File: LICENSE
8
- Requires-Dist: mako>=1.3.5
9
- Dynamic: license-file
10
-
11
1
  # create-pyproj
12
2
 
13
3
  `create-pyproj` scaffolds canonical Python projects with a `uv`-first workflow,
@@ -20,13 +10,15 @@ engineering skills.
20
10
  The default scaffold includes:
21
11
 
22
12
  - `.python-version`
23
- - `pyproject.toml` with `uv`-friendly dependency groups and Ruff configuration
24
- - `mise.toml` with tool pins and common tasks
13
+ - `pyproject.toml` built with `uv_build`, with `uv`-friendly dependency groups and Ruff configuration
14
+ - `mise.toml` with pinned tools and common tasks; it is the one source for the Python and uv versions, locally and in GitHub CI
25
15
  - semantic-release configuration for version stamping in `pyproject.toml` and `src/<package>/__init__.py`
26
16
  - `src/<package>` with `domain`, `application`, and `infrastructure` package structure
27
17
  - `docs/` plus `mkdocs.yml`
28
18
  - `AGENTS.md`
29
19
  - `.vscode/`, `.pre-commit-config.yaml`, and `.env.example`
20
+ - `test/` with starter tests for each generated adapter
21
+ - `renovate.json` so Renovate keeps dependencies, tools and hooks current
30
22
 
31
23
  Optional adapters:
32
24
 
@@ -59,7 +51,7 @@ uv tool install --force .
59
51
 
60
52
  Common flags:
61
53
 
62
- - `--python-version 3.12`
54
+ - `--python-version 3.15` (default: `PYTHON_DEFAULT` in `src/create_pyproj/versions.py`)
63
55
  - `--description "Short project summary"`
64
56
  - `--author "Your Name"`
65
57
  - `--author-email "you@example.com"`
@@ -95,11 +87,24 @@ mise run complexity
95
87
  mise run typecheck
96
88
  mise run format
97
89
  mise run test
90
+ mise run test-e2e
98
91
  uv run python -m create_pyproj.main --help
99
92
  ```
100
93
 
101
94
  The local test suite verifies the emitted scaffold contract rather than just
102
- individual template files.
95
+ individual template files. `mise run test-e2e` generates a project with every
96
+ option and runs its own gates; it needs the network.
97
+
98
+ ## Keeping Versions Current
99
+
100
+ - `src/create_pyproj/versions.py` holds every version the scaffold emits.
101
+ Templates and the CLI read from it.
102
+ - Renovate (`renovate.json`) updates that file and this repo's own pins, one
103
+ PR per dependency. Minor and patch updates automerge when CI passes.
104
+ - `test/test_versions.py` fails when this repo's pins drift from the scaffold's.
105
+ - The `Freshness` workflow runs weekly: the scaffolder and a generated project
106
+ against the newest packages, on the default Python and the next one.
107
+ - The default Python minor moves by hand under the policy in `AGENTS.md`.
103
108
 
104
109
  ## Docs
105
110
 
@@ -0,0 +1,91 @@
1
+ [build-system]
2
+ requires = ["uv_build>=0.13.8,<0.14"]
3
+ build-backend = "uv_build"
4
+
5
+ [project]
6
+ name = "create-pyproj"
7
+ version = "2.2.0"
8
+ description = "Scaffold uv-first Python projects with a DDD and hexagonal baseline."
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ dependencies = ["mako>=1.3.5"]
12
+
13
+ [project.scripts]
14
+ create-pyproj = "create_pyproj.main:main"
15
+
16
+ [tool.ruff]
17
+ line-length = 88
18
+ target-version = "py311"
19
+
20
+ [tool.ruff.lint]
21
+ select = [
22
+ "E",
23
+ "F",
24
+ "W",
25
+ "I",
26
+ "S",
27
+ "C901",
28
+ ]
29
+ ignore = [
30
+ "E203",
31
+ "E501",
32
+ ]
33
+
34
+ [tool.ruff.lint.mccabe]
35
+ max-complexity = 10
36
+
37
+ [tool.ruff.lint.per-file-ignores]
38
+ "test/**" = ["S101"]
39
+
40
+ [tool.ruff.format]
41
+ docstring-code-format = true
42
+
43
+ [tool.semantic_release]
44
+ commit_message = "chore(release): {version} [skip ci]"
45
+ version_toml = ["pyproject.toml:project.version"]
46
+ version_variables = ["src/create_pyproj/__init__.py:__version__"]
47
+ build_command = "uv lock --upgrade-package create-pyproj && git add uv.lock"
48
+
49
+ [tool.semantic_release.remote]
50
+ type = "github"
51
+
52
+ [tool.semantic_release.branches.main]
53
+ match = "main"
54
+
55
+ [tool.semantic_release.branches.master]
56
+ match = "master"
57
+
58
+ [tool.semantic_release.branches.release]
59
+ match = "release"
60
+
61
+ [tool.pytest.ini_options]
62
+ addopts = "-vv -m 'not e2e'"
63
+ markers = ["e2e: generates a project and runs its gates; needs the network"]
64
+ pythonpath = [
65
+ "src",
66
+ "test",
67
+ ]
68
+ testpaths = ["test"]
69
+
70
+ [tool.ty.src]
71
+ include = [
72
+ "src",
73
+ "test",
74
+ ]
75
+
76
+ [dependency-groups]
77
+ dev = [
78
+ "fastapi>=0.163.1",
79
+ "httpx2>=2.16.2",
80
+ "jinja2>=3.1.4",
81
+ "python-multipart>=0.0.9",
82
+ "mkdocs",
83
+ "mkdocs-material",
84
+ "pre-commit>=4.0.1",
85
+ "python-semantic-release",
86
+ "pytest",
87
+ "hypothesis>=6.170.15",
88
+ "ruff>=0.17.5",
89
+ "twine",
90
+ "ty>=0.0.104,<0.1",
91
+ ]
@@ -1,13 +1,13 @@
1
1
  [build-system]
2
- requires = ["setuptools>=61"]
3
- build-backend = "setuptools.build_meta"
2
+ requires = ["uv_build>=0.13.8,<0.14"]
3
+ build-backend = "uv_build"
4
4
 
5
5
  [project]
6
6
  name = "create-pyproj"
7
- version = "2.1.1"
7
+ version = "2.2.0"
8
8
  description = "Scaffold uv-first Python projects with a DDD and hexagonal baseline."
9
- readme = "readme.md"
10
- requires-python = ">=3.10"
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
11
  dependencies = ["mako>=1.3.5"]
12
12
 
13
13
  [project.scripts]
@@ -15,7 +15,7 @@ create-pyproj = "create_pyproj.main:main"
15
15
 
16
16
  [tool.ruff]
17
17
  line-length = 88
18
- target-version = "py310"
18
+ target-version = "py311"
19
19
 
20
20
  [tool.ruff.lint]
21
21
  select = ["E", "F", "W", "I", "S", "C901"]
@@ -36,6 +36,8 @@ commit_message = "chore(release): {version} [skip ci]"
36
36
  remote.type = "github"
37
37
  version_toml = ["pyproject.toml:project.version"]
38
38
  version_variables = ["src/create_pyproj/__init__.py:__version__"]
39
+ # Re-lock after the version stamp so the release commit carries a matching uv.lock.
40
+ build_command = "uv lock --upgrade-package create-pyproj && git add uv.lock"
39
41
 
40
42
  [tool.semantic_release.branches.main]
41
43
  match = "main"
@@ -47,18 +49,15 @@ match = "master"
47
49
  match = "release"
48
50
 
49
51
  [tool.pytest.ini_options]
50
- addopts = "-vv"
52
+ addopts = "-vv -m 'not e2e'"
53
+ markers = ["e2e: generates a project and runs its gates; needs the network"]
51
54
  pythonpath = ["src", "test"]
52
55
  testpaths = ["test"]
53
56
 
54
- [tool.setuptools.packages.find]
55
- where = ["src"]
56
-
57
57
  [dependency-groups]
58
58
  dev = [
59
- "build",
60
- "fastapi>=0.115",
61
- "httpx",
59
+ "fastapi>=0.163.1",
60
+ "httpx2>=2.16.2",
62
61
  "jinja2>=3.1.4",
63
62
  "python-multipart>=0.0.9",
64
63
  "mkdocs",
@@ -66,10 +65,10 @@ dev = [
66
65
  "pre-commit>=4.0.1",
67
66
  "python-semantic-release",
68
67
  "pytest",
69
- "hypothesis>=6.100",
70
- "ruff>=0.15.12",
68
+ "hypothesis>=6.170.15",
69
+ "ruff>=0.17.5",
71
70
  "twine",
72
- "ty>=0.0.75,<0.1",
71
+ "ty>=0.0.104,<0.1",
73
72
  ]
74
73
 
75
74
  [tool.ty.src]
@@ -2,4 +2,4 @@
2
2
 
3
3
  __all__ = ["__version__"]
4
4
 
5
- __version__ = "2.1.1"
5
+ __version__ = "2.2.0"
@@ -5,7 +5,7 @@ from __future__ import annotations
5
5
  import argparse
6
6
  from pathlib import Path
7
7
 
8
- from . import __version__
8
+ from . import __version__, versions
9
9
  from .scaffold import ProjectOptions, create_project
10
10
 
11
11
 
@@ -30,8 +30,11 @@ def build_parser() -> argparse.ArgumentParser:
30
30
  )
31
31
  parser.add_argument(
32
32
  "--python-version",
33
- default="3.12",
34
- help="Version string to write to .python-version. Defaults to 3.12.",
33
+ default=versions.PYTHON_DEFAULT,
34
+ help=(
35
+ "Version string to write to .python-version. "
36
+ f"Defaults to {versions.PYTHON_DEFAULT}."
37
+ ),
35
38
  )
36
39
  parser.add_argument(
37
40
  "--description",
@@ -6,6 +6,7 @@ from dataclasses import dataclass
6
6
  from pathlib import Path
7
7
  from subprocess import CalledProcessError, run # nosec B404
8
8
 
9
+ from . import versions
9
10
  from .templater import quoted, render_template_tree
10
11
 
11
12
  TEMPLATES_DIR = Path(__file__).parent / "templates"
@@ -16,7 +17,7 @@ class ProjectOptions:
16
17
  """Options that control scaffold generation."""
17
18
 
18
19
  project_name: str
19
- python_version: str = "3.12"
20
+ python_version: str = versions.PYTHON_DEFAULT
20
21
  description: str = "Canonical Python project scaffold."
21
22
  author: str = ""
22
23
  author_email: str = ""
@@ -141,7 +142,9 @@ def _build_context(options: ProjectOptions) -> dict[str, object]:
141
142
  "python_major_minor": options.python_major_minor,
142
143
  "python_version": options.python_version,
143
144
  "quoted": quoted,
145
+ "req": versions.REQUIREMENTS,
144
146
  "ruff_target_version": options.ruff_target_version,
147
+ "versions": versions,
145
148
  }
146
149
 
147
150
 
@@ -1,6 +1,6 @@
1
1
  repos:
2
2
  - repo: https://github.com/astral-sh/ruff-pre-commit
3
- rev: v0.15.12
3
+ rev: v${versions.RUFF}
4
4
  hooks:
5
5
  - id: ruff-check
6
6
  name: ruff import sort
@@ -39,3 +39,4 @@ and similar material written for agents or contributors.
39
39
  - Render user input through Jinja2 templates rather than assembling HTML in Python; autoescaping is what keeps submitted markup inert.
40
40
  % endif
41
41
  - Keep `docs/` and `mkdocs.yml` aligned with the implementation.
42
+ - Renovate (`renovate.json`) keeps dependencies, mise tools and hooks current. Pin new tools to an exact version, never `latest`. Move to a new Python minor by hand, once its x.y.1 release is out.
@@ -1,11 +1,11 @@
1
1
  [tools]
2
2
  python = "${python_version}"
3
- uv = "latest"
4
- terraform = "latest"
5
- aws-cli = "latest"
6
- jq = "latest"
7
- shellcheck = "latest"
8
- shfmt = "latest"
3
+ uv = "${versions.UV}"
4
+ terraform = "${versions.TERRAFORM}"
5
+ aws-cli = "${versions.AWS_CLI}"
6
+ jq = "${versions.JQ}"
7
+ shellcheck = "${versions.SHELLCHECK}"
8
+ shfmt = "${versions.SHFMT}"
9
9
 
10
10
  # uv must never manage its own interpreters: mise owns python. Without these,
11
11
  # `uv sync` silently re-downloads a uv-managed CPython and the split returns.
@@ -59,5 +59,5 @@ run = "uv run uvicorn ${package_name}.web:app --reload"
59
59
  # under a strict content-security policy. Pin the version deliberately.
60
60
  [tasks.vendor-htmx]
61
61
  description = "Download HTMX into the UI static directory"
62
- run = "curl -fsSL https://unpkg.com/htmx.org@2.0.4/dist/htmx.min.js -o src/${package_name}/ui/static/htmx.min.js"
62
+ run = "curl -fsSL https://unpkg.com/htmx.org@${versions.HTMX}/dist/htmx.min.js -o src/${package_name}/ui/static/htmx.min.js"
63
63
  % endif
@@ -1,6 +1,6 @@
1
1
  [build-system]
2
- requires = ["setuptools>=61"]
3
- build-backend = "setuptools.build_meta"
2
+ requires = ["${req['uv_build']}"]
3
+ build-backend = "uv_build"
4
4
 
5
5
  [project]
6
6
  name = "${project_name}"
@@ -8,7 +8,7 @@ version = "0.1.0"
8
8
  description = ${description | quoted}
9
9
  readme = "README.md"
10
10
  requires-python = ">=${python_major_minor}"
11
- license = {text = "MIT"}
11
+ license = "MIT"
12
12
  % if author_has_value:
13
13
  authors = [
14
14
  % if author_email_has_value:
@@ -19,12 +19,12 @@ authors = [
19
19
  ]
20
20
  % endif
21
21
  dependencies = [
22
- "pydantic>=2.8",
22
+ "${req['pydantic']}",
23
23
  % if has_web:
24
- "fastapi>=0.115",
25
- "uvicorn>=0.30",
26
- "jinja2>=3.1.4",
27
- "python-multipart>=0.0.9",
24
+ "${req['fastapi']}",
25
+ "${req['uvicorn']}",
26
+ "${req['jinja2']}",
27
+ "${req['python-multipart']}",
28
28
  % endif
29
29
  ]
30
30
 
@@ -75,25 +75,17 @@ addopts = "-vv"
75
75
  pythonpath = ["src", "test"]
76
76
  testpaths = ["test"]
77
77
 
78
- [tool.setuptools.packages.find]
79
- where = ["src"]
80
- % if has_web:
81
-
82
- [tool.setuptools.package-data]
83
- "*" = ["ui/templates/*.html", "ui/static/*"]
84
- % endif
85
-
86
78
  [dependency-groups]
87
79
  dev = [
88
- "mkdocs>=1.6.1",
89
- "mkdocs-material>=9.5.44",
90
- "pre-commit>=4.0.1",
91
- "python-semantic-release>=10.0.0",
92
- "pytest>=8.3.3",
93
- "hypothesis>=6.100",
94
- "ruff>=0.15.12",
95
- "ty>=0.0.75,<0.1",
80
+ "${req['mkdocs']}",
81
+ "${req['mkdocs-material']}",
82
+ "${req['pre-commit']}",
83
+ "${req['python-semantic-release']}",
84
+ "${req['pytest']}",
85
+ "${req['hypothesis']}",
86
+ "${req['ruff']}",
87
+ "${req['ty']}",
96
88
  % if has_web:
97
- "httpx>=0.27.2",
89
+ "${req['httpx2']}",
98
90
  % endif
99
91
  ]
@@ -0,0 +1,52 @@
1
+ {
2
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
+ "extends": ["config:recommended", ":semanticCommitTypeAll(chore)"],
4
+ "schedule": ["before 6am on monday"],
5
+ "pre-commit": { "enabled": true },
6
+ "lockFileMaintenance": { "enabled": true },
7
+ % if has_web:
8
+ "customManagers": [
9
+ {
10
+ "customType": "regex",
11
+ "description": "Vendored HTMX in the vendor-htmx mise task",
12
+ "managerFilePatterns": ["/^mise\\.toml$/"],
13
+ "matchStrings": ["htmx\\.org@(?<currentValue>[0-9][^/]*)/"],
14
+ "depNameTemplate": "htmx.org",
15
+ "datasourceTemplate": "npm"
16
+ }
17
+ ],
18
+ % endif
19
+ "packageRules": [
20
+ {
21
+ "description": "Keep pyproject.toml floors in step with uv.lock",
22
+ "matchManagers": ["pep621"],
23
+ "rangeStrategy": "bump"
24
+ },
25
+ {
26
+ "description": "ty breaks between 0.0.x releases",
27
+ "matchDepNames": ["ty"],
28
+ "allowedVersions": "<0.1"
29
+ },
30
+ {
31
+ "description": "Move to a new Python minor by hand, once its x.y.1 is out",
32
+ "matchDepNames": ["python"],
33
+ "matchUpdateTypes": ["major", "minor"],
34
+ "enabled": false
35
+ },
36
+ {
37
+ "description": "uv_build releases with uv; move both, and its upper bound, together",
38
+ "matchDepNames": ["uv", "uv_build", "uv-build"],
39
+ "groupName": "uv",
40
+ "rangeStrategy": "replace"
41
+ },
42
+ {
43
+ "description": "Ruff and its pre-commit hook move together",
44
+ "matchDepNames": ["ruff", "astral-sh/ruff-pre-commit"],
45
+ "groupName": "ruff"
46
+ },
47
+ {
48
+ "matchUpdateTypes": ["minor", "patch", "digest"],
49
+ "automerge": true
50
+ }
51
+ ]
52
+ }
@@ -0,0 +1,17 @@
1
+ """Package metadata stays consistent across releases."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import tomllib
6
+ from pathlib import Path
7
+
8
+ import ${package_name}
9
+
10
+ PYPROJECT = Path(__file__).resolve().parent.parent / "pyproject.toml"
11
+
12
+
13
+ def test_package_version_matches_project_version() -> None:
14
+ # semantic-release stamps both; a mismatch means a release went wrong.
15
+ project = tomllib.loads(PYPROJECT.read_text())["project"]
16
+
17
+ assert ${package_name}.__version__ == project["version"]
@@ -1,22 +1,22 @@
1
1
  name: CI
2
2
 
3
- permissions:
4
- contents: write
5
-
6
3
  on:
7
4
  push:
8
5
  branches: [main]
9
6
  pull_request:
10
7
 
8
+ permissions:
9
+ contents: read
10
+
11
11
  jobs:
12
12
  test:
13
13
  runs-on: ubuntu-latest
14
14
  steps:
15
- - uses: actions/checkout@v4
16
- - uses: actions/setup-python@v5
15
+ - uses: actions/checkout@${versions.ACTIONS_CHECKOUT}
16
+ # mise.toml is the one source for the Python and uv versions.
17
+ - uses: jdx/mise-action@${versions.ACTIONS_MISE}
17
18
  with:
18
- python-version: "${python_major_minor}"
19
- - uses: astral-sh/setup-uv@v3
19
+ install_args: python uv
20
20
  - run: uv sync --all-groups --frozen
21
21
  - run: uv run ruff format --check .
22
22
  - run: uv run ruff check .
@@ -28,14 +28,15 @@ jobs:
28
28
  if: github.event_name == 'push' && github.ref == 'refs/heads/main'
29
29
  needs: test
30
30
  runs-on: ubuntu-latest
31
+ permissions:
32
+ contents: write
31
33
  steps:
32
- - uses: actions/checkout@v4
34
+ - uses: actions/checkout@${versions.ACTIONS_CHECKOUT}
33
35
  with:
34
36
  fetch-depth: 0
35
- - uses: actions/setup-python@v5
37
+ - uses: jdx/mise-action@${versions.ACTIONS_MISE}
36
38
  with:
37
- python-version: "${python_major_minor}"
38
- - uses: astral-sh/setup-uv@v3
39
+ install_args: python uv
39
40
  - run: uv sync --all-groups --frozen
40
41
  - run: uv run semantic-release version
41
42
  env:
@@ -5,8 +5,11 @@ stages:
5
5
  - test
6
6
  - Release
7
7
 
8
+ variables:
9
+ UV_PYTHON_DOWNLOADS: never
10
+
8
11
  before_script:
9
- - pip install --upgrade pip uv
12
+ - pip install "uv==${versions.UV}"
10
13
  - uv sync --all-groups --frozen
11
14
 
12
15
  ruff:
@@ -0,0 +1,26 @@
1
+ """The CLI adapter parses its arguments and reports through exit codes."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import pytest
6
+
7
+ from ${package_name}.cli import main
8
+
9
+
10
+ def test_cli_without_arguments_succeeds() -> None:
11
+ assert main([]) == 0
12
+
13
+
14
+ def test_cli_help_names_the_program(capsys: pytest.CaptureFixture[str]) -> None:
15
+ with pytest.raises(SystemExit) as exit_info:
16
+ main(["--help"])
17
+
18
+ assert exit_info.value.code == 0
19
+ assert "${project_name}" in capsys.readouterr().out
20
+
21
+
22
+ def test_cli_rejects_an_unknown_option() -> None:
23
+ with pytest.raises(SystemExit) as exit_info:
24
+ main(["--no-such-option"])
25
+
26
+ assert exit_info.value.code == 2