2323nox .options .default_venv_backend = "venv"
2424nox .options .reuse_existing_virtualenvs = True
2525
26- os .environ .update ({"PDM_IGNORE_SAVED_PYTHON" : "1" })
27-
26+ IS_CI = bool (os .getenv ("CI" , False ))
2827PACKAGE_NAME = "django_registration"
2928
3029NOXFILE_PATH = pathlib .Path (__file__ ).parents [0 ]
@@ -73,8 +72,7 @@ def tests_with_coverage(session: nox.Session, django: str) -> None:
7372 Run the package's unit tests, with coverage report.
7473
7574 """
76- session .install (f"Django~={ django } .0" )
77- session .run_always ("pdm" , "install" , "-dG" , "tests" , external = True )
75+ session .install (f"Django~={ django } .0" , ".[tests]" )
7876 python_version = session .run (
7977 f"{ session .bin } /python{ session .python } " , "--version" , silent = True
8078 ).strip ()
@@ -98,27 +96,40 @@ def tests_with_coverage(session: nox.Session, django: str) -> None:
9896 "runtests.py" ,
9997 env = {"DJANGO_SETTINGS_MODULE" : "tests.settings" },
10098 )
99+ clean ()
100+
101+
102+ @nox .session (python = ["3.13" ], tags = ["tests" ])
103+ def coverage_report (session : nox .Session ) -> None :
104+ """
105+ Combine coverage from the various test runs and output the report.
106+
107+ """
108+ # In CI this job does not run because we substitute one that integrates with the CI
109+ # system.
110+ if IS_CI :
111+ session .skip (
112+ "Running in CI -- skipping nox coverage job in favor of CI coverage job"
113+ )
114+ session .install ("coverage[toml]" )
115+ session .run (f"python{ session .python } " , "-Im" , "coverage" , "combine" )
101116 session .run (
102- f"{ session .bin } /python{ session .python } " ,
103- "-Im" ,
104- "coverage" ,
105- "report" ,
106- "--show-missing" ,
117+ f"python{ session .python } " , "-Im" , "coverage" , "report" , "--show-missing"
107118 )
108- clean ( )
119+ session . run ( f"python { session . python } " , "-Im" , "coverage" , "erase" )
109120
110121
111122# Tasks which test the package's documentation.
112123# -----------------------------------------------------------------------------------
113124
114125
115- @nox .session (python = ["3.12 " ], tags = ["docs" ])
126+ @nox .session (python = ["3.13 " ], tags = ["docs" ])
116127def docs_build (session : nox .Session ) -> None :
117128 """
118129 Build the package's documentation as HTML.
119130
120131 """
121- session .run_always ( "pdm" , "install" , "-dG" , " docs" , external = True )
132+ session .install ( ".[ docs]" )
122133 build_dir = session .create_tmp ()
123134 session .run (
124135 f"{ session .bin } /python{ session .python } " ,
@@ -137,7 +148,7 @@ def docs_build(session: nox.Session) -> None:
137148 clean ()
138149
139150
140- @nox .session (python = ["3.12 " ], tags = ["docs" ])
151+ @nox .session (python = ["3.13 " ], tags = ["docs" ])
141152def docs_docstrings (session : nox .Session ) -> None :
142153 """
143154 Enforce the presence of docstrings on all modules, classes, functions, and
@@ -160,13 +171,13 @@ def docs_docstrings(session: nox.Session) -> None:
160171 clean ()
161172
162173
163- @nox .session (python = ["3.12 " ], tags = ["docs" ])
174+ @nox .session (python = ["3.13 " ], tags = ["docs" ])
164175def docs_spellcheck (session : nox .Session ) -> None :
165176 """
166177 Spell-check the package's documentation.
167178
168179 """
169- session .run_always ( "pdm" , "install" , "-dG" , " docs" , external = True )
180+ session .install ( ".[ docs]" )
170181 session .install ("pyenchant" , "sphinxcontrib-spelling" )
171182 build_dir = session .create_tmp ()
172183 session .run (
@@ -197,7 +208,7 @@ def docs_spellcheck(session: nox.Session) -> None:
197208# -----------------------------------------------------------------------------------
198209
199210
200- @nox .session (python = ["3.12 " ], tags = ["formatters" ])
211+ @nox .session (python = ["3.13 " ], tags = ["formatters" ])
201212def format_black (session : nox .Session ) -> None :
202213 """
203214 Check code formatting with Black.
@@ -219,7 +230,7 @@ def format_black(session: nox.Session) -> None:
219230 clean ()
220231
221232
222- @nox .session (python = ["3.12 " ], tags = ["formatters" ])
233+ @nox .session (python = ["3.13 " ], tags = ["formatters" ])
223234def format_isort (session : nox .Session ) -> None :
224235 """
225236 Check code formating with Black.
@@ -245,7 +256,7 @@ def format_isort(session: nox.Session) -> None:
245256# -----------------------------------------------------------------------------------
246257
247258
248- @nox .session (python = ["3.12 " ], tags = ["linters" , "security" ])
259+ @nox .session (python = ["3.13 " ], tags = ["linters" , "security" ])
249260def lint_bandit (session : nox .Session ) -> None :
250261 """
251262 Lint code with the Bandit security analyzer.
@@ -266,7 +277,7 @@ def lint_bandit(session: nox.Session) -> None:
266277 clean ()
267278
268279
269- @nox .session (python = ["3.12 " ], tags = ["linters" ])
280+ @nox .session (python = ["3.13 " ], tags = ["linters" ])
270281def lint_flake8 (session : nox .Session ) -> None :
271282 """
272283 Lint code with flake8.
@@ -286,7 +297,7 @@ def lint_flake8(session: nox.Session) -> None:
286297 clean ()
287298
288299
289- @nox .session (python = ["3.12 " ], tags = ["linters" ])
300+ @nox .session (python = ["3.13 " ], tags = ["linters" ])
290301def lint_pylint (session : nox .Session ) -> None :
291302 """
292303 Lint code with Pylint.
@@ -305,7 +316,7 @@ def lint_pylint(session: nox.Session) -> None:
305316# -----------------------------------------------------------------------------------
306317
307318
308- @nox .session (python = ["3.12 " ], tags = ["packaging" ])
319+ @nox .session (python = ["3.13 " ], tags = ["packaging" ])
309320def package_build (session : nox .Session ) -> None :
310321 """
311322 Check that the package builds.
@@ -317,7 +328,7 @@ def package_build(session: nox.Session) -> None:
317328 session .run (f"{ session .bin } /python{ session .python } " , "-Im" , "build" )
318329
319330
320- @nox .session (python = ["3.12 " ], tags = ["packaging" ])
331+ @nox .session (python = ["3.13 " ], tags = ["packaging" ])
321332def package_description (session : nox .Session ) -> None :
322333 """
323334 Check that the package description will render on the Python Package Index.
@@ -345,7 +356,7 @@ def package_description(session: nox.Session) -> None:
345356 clean ()
346357
347358
348- @nox .session (python = ["3.12 " ], tags = ["packaging" ])
359+ @nox .session (python = ["3.13 " ], tags = ["packaging" ])
349360def package_manifest (session : nox .Session ) -> None :
350361 """
351362 Check that the set of files in the package matches the set under version
@@ -362,7 +373,7 @@ def package_manifest(session: nox.Session) -> None:
362373 clean ()
363374
364375
365- @nox .session (python = ["3.12 " ], tags = ["packaging" ])
376+ @nox .session (python = ["3.13 " ], tags = ["packaging" ])
366377def package_pyroma (session : nox .Session ) -> None :
367378 """
368379 Check package quality with pyroma.
@@ -378,7 +389,7 @@ def package_pyroma(session: nox.Session) -> None:
378389 clean ()
379390
380391
381- @nox .session (python = ["3.12 " ], tags = ["packaging" ])
392+ @nox .session (python = ["3.13 " ], tags = ["packaging" ])
382393def package_wheel (session : nox .Session ) -> None :
383394 """
384395 Check the built wheel package for common errors.
0 commit comments