|
13 | 13 | MIN_PYTHON_VERSION_SLUG: int = int("{{cookiecutter.min_python_version}}".lstrip("3.")) |
14 | 14 | MAX_PYTHON_VERSION_SLUG: int = int("{{cookiecutter.max_python_version}}".lstrip("3.")) |
15 | 15 |
|
16 | | -# Python versions to test against. As of April {{cookiecutter.copyright_year}}, generally {{cookiecutter.min_python_version}}-{{cookiecutter.max_python_version}} are actively supported. |
17 | | -# See: https://devguide.python.org/versions/ and https://endoflife.date/python |
18 | 16 | PYTHON_VERSIONS: List[str] = [ |
19 | 17 | f"3.{VERSION_SLUG}" for VERSION_SLUG in range(MIN_PYTHON_VERSION_SLUG, MAX_PYTHON_VERSION_SLUG + 1) |
20 | 18 | ] |
|
25 | 23 | PACKAGE_NAME: str = "{{cookiecutter.package_name}}" |
26 | 24 |
|
27 | 25 |
|
28 | | -# --- GRANULAR TASK AUTOMATION SESSIONS --- |
29 | | -# These sessions perform specific types of checks or builds. |
30 | | -# Their names align with modular CI workflow files. |
31 | | - |
32 | 26 | @nox.session(python=DEFAULT_PYTHON_VERSION, name="format-python") |
33 | 27 | def format_python(session: Session) -> None: |
34 | 28 | """Run Python code formatter (Ruff format).""" |
@@ -173,7 +167,7 @@ def build_container(session: Session) -> None: |
173 | 167 | def publish_python(session: Session) -> None: |
174 | 168 | """Publish sdist and wheel packages to PyPI via uv publish. |
175 | 169 |
|
176 | | - Requires packages to be built first (`nox -s build_python` or `nox -s build`). |
| 170 | + Requires packages to be built first (`nox -s build-python` or `nox -s build`). |
177 | 171 | Requires TWINE_USERNAME/TWINE_PASSWORD or TWINE_API_KEY environment variables set (usually in CI). |
178 | 172 | """ |
179 | 173 | session.log("Checking built packages with Twine.") |
@@ -266,36 +260,33 @@ def build(session: Session) -> None: |
266 | 260 | session.notify("build_rust") # Build Rust crate first if Rust is enabled |
267 | 261 | {% endif %} |
268 | 262 | # Then build the Python package (uv build) |
269 | | - session.notify("build_python") # Build Python sdist/wheel |
| 263 | + session.notify("build-python") # Build Python sdist/wheel |
270 | 264 |
|
271 | 265 |
|
272 | 266 | @nox.session(python=DEFAULT_PYTHON_VERSION) # Run the orchestrator on the default Python version |
273 | 267 | def publish(session: Session) -> None: |
274 | 268 | """Orchestrates publishing all project artifacts (Python packages, potentially Rust).""" |
275 | 269 | session.log(f"Queueing publish sessions for py{session.python} if applicable.") |
276 | | - session.notify("publish_python") # Publish Python sdist/wheel |
| 270 | + session.notify("publish-python") # Publish Python sdist/wheel |
277 | 271 | # Note: publish_rust session might be notified here if needed. |
278 | 272 |
|
279 | 273 |
|
280 | 274 | @nox.session(python=PYTHON_VERSIONS) |
281 | 275 | def check(session: Session) -> None: |
282 | 276 | """Run primary quality checks (format, lint, typecheck, security).""" |
283 | 277 | session.log(f"Queueing core check sessions for py{session.python} if applicable.") |
284 | | - # Notify granular sessions. Their python version is controlled by their decorators. |
285 | | - # Sessions without explicit python versions or limited run on DEFAULT_PYTHON_VERSION. |
286 | | - session.notify("format_python") |
287 | | - session.notify("lint_python") |
288 | | - session.notify("typecheck_python") |
289 | | - session.notify("security_python") |
290 | | - session.notify("security_deps") |
| 278 | + session.notify("format-python") |
| 279 | + session.notify("lint-python") |
| 280 | + session.notify("typecheck") |
| 281 | + session.notify("security-python") |
291 | 282 |
|
292 | 283 |
|
293 | 284 | @nox.session(python=PYTHON_VERSIONS, name="full-check") |
294 | 285 | def full_check(session: Session) -> None: |
295 | 286 | """Run all core quality checks and tests.""" |
296 | 287 | session.log(f"Queueing all check and test sessions for py{session.python} if applicable.") |
297 | 288 | session.notify("check") |
298 | | - session.notify("test_python") |
| 289 | + session.notify("tests-python") |
299 | 290 |
|
300 | 291 |
|
301 | 292 | @nox.session(python=DEFAULT_PYTHON_VERSION) |
|
0 commit comments