@@ -71,14 +71,11 @@ def precommit(session: Session) -> None:
7171 activate_virtualenv_in_precommit_hooks (session )
7272
7373
74- @nox .session (python = DEFAULT_PYTHON_VERSION , name = "format-python" , tags = [FORMAT , PYTHON ])
74+ @nox .session (python = None , name = "format-python" , tags = [FORMAT , PYTHON ])
7575def format_python (session : Session ) -> None :
7676 """Run Python code formatter (Ruff format)."""
77- session .log ("Installing formatting dependencies..." )
78- session .install ("-e" , "." , "--group" , "dev" )
79-
8077 session .log (f"Running Ruff formatter check with py{ session .python } ." )
81- session .run ("ruff" , "format" , * session .posargs )
78+ session .run ("uvx" , " ruff" , "format" , * session .posargs )
8279
8380
8481{% if cookiecutter .add_rust_extension == "y" - % }
@@ -92,14 +89,11 @@ def format_rust(session: Session) -> None:
9289
9390
9491{% endif - % }
95- @nox .session (python = DEFAULT_PYTHON_VERSION , name = "lint-python" , tags = [LINT , PYTHON ])
92+ @nox .session (python = None , name = "lint-python" , tags = [LINT , PYTHON ])
9693def lint_python (session : Session ) -> None :
9794 """Run Python code linters (Ruff check, Pydocstyle rules)."""
98- session .log ("Installing linting dependencies..." )
99- session .install ("-e" , "." , "--group" , "dev" )
100-
10195 session .log (f"Running Ruff check with py{ session .python } ." )
102- session .run ("ruff" , "check" , "--fix" , "--verbose" )
96+ session .run ("uvx" , " ruff" , "check" , "--fix" , "--verbose" )
10397
10498
10599{% if cookiecutter .add_rust_extension == "y" - % }
@@ -117,23 +111,20 @@ def lint_rust(session: Session) -> None:
117111def typecheck (session : Session ) -> None :
118112 """Run static type checking (Pyright) on Python code."""
119113 session .log ("Installing type checking dependencies..." )
120- session .install ("-e" , "." , "--group" , "dev " )
114+ session .install ("pyright " )
121115
122116 session .log (f"Running Pyright check with py{ session .python } ." )
123117 session .run ("pyright" )
124118
125119
126- @nox .session (python = DEFAULT_PYTHON_VERSION , name = "security-python" , tags = [SECURITY , PYTHON , CI ])
120+ @nox .session (python = None , name = "security-python" , tags = [SECURITY , PYTHON , CI ])
127121def security_python (session : Session ) -> None :
128122 """Run code security checks (Bandit) on Python code."""
129- session .log ("Installing security dependencies..." )
130- session .install ("-e" , "." , "--group" , "dev" )
131-
132123 session .log (f"Running Bandit static security analysis with py{ session .python } ." )
133- session .run ("bandit" , "-r" , PACKAGE_NAME , "-c" , "bandit.yml" , "-ll" )
124+ session .run ("uvx" , " bandit" , "-r" , PACKAGE_NAME , "-c" , "bandit.yml" , "-ll" )
134125
135126 session .log (f"Running pip-audit dependency security check with py{ session .python } ." )
136- session .run ("pip-audit" )
127+ session .run ("uvx" , " pip-audit" )
137128
138129
139130{% if cookiecutter .add_rust_extension == 'y' - % }
@@ -155,11 +146,12 @@ def tests_python(session: Session) -> None:
155146 session .log (f"Running test suite with py{ session .python } ." )
156147 test_results_dir = Path ("test-results" )
157148 test_results_dir .mkdir (parents = True , exist_ok = True )
158- junitxml_file = test_results_dir / f"test-results-py{ session .python } .xml"
149+ junitxml_file = test_results_dir / f"test-results-py{ session .python . replace ( '.' , '' ) } .xml"
159150
160151 session .run (
161152 "pytest" ,
162153 "--cov={}" .format (PACKAGE_NAME ),
154+ "--cov-append" ,
163155 "--cov-report=term" ,
164156 "--cov-report=xml" ,
165157 f"--junitxml={ junitxml_file } " ,
@@ -201,7 +193,7 @@ def build_python(session: Session) -> None:
201193 {% if cookiecutter .add_rust_extension == "y" - % }
202194 session .run ("maturin" , "develop" , "--uv" )
203195 {% else - % }
204- session .run ("uv" , "build" , "--sdist" , "--wheel" , "--outdir " , "dist/" , external = True )
196+ session .run ("uv" , "build" , "--sdist" , "--wheel" , "--out-dir " , "dist/" , external = True )
205197 {% endif - % }
206198
207199 session .log ("Built packages in ./dist directory:" )
@@ -248,17 +240,15 @@ def build_container(session: Session) -> None:
248240 session .log (f"Container image { project_image_name } :latest built locally." )
249241
250242
251- @nox .session (python = DEFAULT_PYTHON_VERSION , name = "publish-python" , tags = [RELEASE ])
243+ @nox .session (python = None , name = "publish-python" , tags = [RELEASE ])
252244def publish_python (session : Session ) -> None :
253245 """Publish sdist and wheel packages to PyPI via uv publish.
254246
255247 Requires packages to be built first (`nox -s build-python` or `nox -s build`).
256248 Requires TWINE_USERNAME/TWINE_PASSWORD or TWINE_API_KEY environment variables set (usually in CI).
257249 """
258- session .install ("twine" )
259-
260250 session .log ("Checking built packages with Twine." )
261- session .run ("twine" , "check" , "dist/*" )
251+ session .run ("uvx" , " twine" , "check" , "dist/*" )
262252
263253 session .log ("Publishing packages to PyPI." )
264254 session .run ("uv" , "publish" , "dist/*" , external = True )
@@ -275,7 +265,7 @@ def publish_rust(session: Session) -> None:
275265
276266
277267{% endif - % }
278- @nox .session (venv_backend = "none" , tags = [RELEASE ])
268+ @nox .session (python = None , tags = [RELEASE ])
279269def release (session : Session ) -> None :
280270 """Run the release process using Commitizen.
281271
@@ -290,15 +280,15 @@ def release(session: Session) -> None:
290280 session .skip ("Git not available." )
291281
292282 session .log ("Checking Commitizen availability via uvx." )
293- session .run ("cz " , "--version" , success_codes = [0 ])
283+ session .run ("uvx " , "--from=commitizen" , "cz" , " version" , success_codes = [0 ])
294284
295285 increment = session .posargs [0 ] if session .posargs else None
296286 session .log (
297287 "Bumping version and tagging release (increment: %s)." ,
298288 increment if increment else "default" ,
299289 )
300290
301- cz_bump_args = ["uvx" , "cz" , "bump" , "--changelog" ]
291+ cz_bump_args = ["uvx" , "--from=commitizen" , " cz" , "bump" , "--changelog" ]
302292
303293 if increment :
304294 cz_bump_args .append (f"--increment={ increment } " )
@@ -310,7 +300,7 @@ def release(session: Session) -> None:
310300 session .log ("IMPORTANT: Push commits and tags to remote (`git push --follow-tags`) to trigger CD pipeline." )
311301
312302
313- @nox .session (venv_backend = "none" )
303+ @nox .session (python = None )
314304def tox (session : Session ) -> None :
315305 """Run the 'tox' test matrix.
316306
0 commit comments