2424
2525import nox
2626
27- nox .needs_version = ">=2024.3.2 "
27+ nox .needs_version = ">=2025.2.9 "
2828nox .options .sessions = ["rr_lint" , "rr_tests" , "rr_pylint" , "readme" ]
2929nox .options .default_venv_backend = "uv|virtualenv"
3030
31+
3132DIR = Path (__file__ ).parent .resolve ()
3233with DIR .joinpath ("cookiecutter.json" ).open () as f :
3334 BACKENDS = json .load (f )["backend" ]
@@ -178,7 +179,7 @@ def diff_files(p1: Path, p2: Path) -> bool:
178179 return same
179180
180181
181- @nox .session ()
182+ @nox .session (default = False )
182183@nox .parametrize ("vcs" , [False , True ], ids = ["novcs" , "vcs" ])
183184@nox .parametrize ("backend" , BACKENDS , ids = BACKENDS )
184185def lint (session : nox .Session , backend : str , vcs : bool ) -> None :
@@ -198,7 +199,7 @@ def lint(session: nox.Session, backend: str, vcs: bool) -> None:
198199 )
199200
200201
201- @nox .session
202+ @nox .session ( default = False )
202203@nox .parametrize ("backend" , BACKENDS , ids = BACKENDS )
203204def autoupdate (session : nox .Session , backend : str ) -> None :
204205 session .install ("cookiecutter" , "pre-commit" )
@@ -212,7 +213,7 @@ def autoupdate(session: nox.Session, backend: str) -> None:
212213 session .run ("git" , "diff" , "--exit-code" , external = True )
213214
214215
215- @nox .session ()
216+ @nox .session (default = False )
216217@nox .parametrize ("vcs" , [False , True ], ids = ["novcs" , "vcs" ])
217218@nox .parametrize ("backend" , BACKENDS , ids = BACKENDS )
218219def tests (session : nox .Session , backend : str , vcs : bool ) -> None :
@@ -236,7 +237,7 @@ def tests(session: nox.Session, backend: str, vcs: bool) -> None:
236237 assert version == expected_version , f"{ version = } != { expected_version = } "
237238
238239
239- @nox .session ()
240+ @nox .session (default = False )
240241@nox .parametrize ("vcs" , [False , True ], ids = ["novcs" , "vcs" ])
241242@nox .parametrize ("backend" , ("poetry" , "pdm" , "hatch" ), ids = ("poetry" , "pdm" , "hatch" ))
242243def native (session : nox .Session , backend : str , vcs : bool ) -> None :
@@ -257,7 +258,7 @@ def native(session: nox.Session, backend: str, vcs: bool) -> None:
257258 session .run (backend , "run" , "pytest" )
258259
259260
260- @nox .session ()
261+ @nox .session (default = False )
261262@nox .parametrize ("vcs" , [False , True ], ids = ["novcs" , "vcs" ])
262263@nox .parametrize ("backend" , BACKENDS , ids = BACKENDS )
263264def dist (session : nox .Session , backend : str , vcs : bool ) -> None :
@@ -305,7 +306,7 @@ def dist(session: nox.Session, backend: str, vcs: bool) -> None:
305306 wheel .rename (dist / wheel .stem )
306307
307308
308- @nox .session (name = "nox" )
309+ @nox .session (name = "nox" , default = False )
309310@nox .parametrize ("vcs" , [False , True ], ids = ["novcs" , "vcs" ])
310311@nox .parametrize ("backend" , BACKENDS , ids = BACKENDS )
311312def nox_session (session : nox .Session , backend : str , vcs : bool ) -> None :
@@ -322,7 +323,7 @@ def nox_session(session: nox.Session, backend: str, vcs: bool) -> None:
322323 session .run ("nox" )
323324
324325
325- @nox .session ()
326+ @nox .session (default = False )
326327def compare_copier (session ):
327328 # Copier 9.5.0 broke `--data`
328329 # Copier 9.7.0/9.7.1 broke everything
@@ -342,7 +343,7 @@ def compare_copier(session):
342343 session .error (f"{ backend } { vcs = } files are not the same!" )
343344
344345
345- @nox .session ()
346+ @nox .session (default = False )
346347def compare_cruft (session ):
347348 session .install ("cookiecutter" , "cruft" )
348349
@@ -375,7 +376,7 @@ def compare_cruft(session):
375376GHA_VERS = re .compile (r"[\s\-]+uses: (.*?)@([^\s]+)" )
376377
377378
378- @nox .session (reuse_venv = True )
379+ @nox .session (reuse_venv = True , default = False )
379380def pc_bump (session : nox .Session ) -> None :
380381 """
381382 Bump the pre-commit versions.
@@ -439,7 +440,7 @@ def get_latest_version_tag(repo: str, old_version: str) -> dict[str, Any] | None
439440 return None
440441
441442
442- @nox .session (venv_backend = "none" )
443+ @nox .session (venv_backend = "none" , default = False )
443444def gha_bump (session : nox .Session ) -> None :
444445 """
445446 Bump the GitHub Actions.
@@ -484,7 +485,7 @@ def readme(session: nox.Session) -> None:
484485 session .run ("cog" , "-P" , * args , "README.md" )
485486
486487
487- @nox .session (reuse_venv = True )
488+ @nox .session (reuse_venv = True , default = False )
488489def rr_run (session : nox .Session ) -> None :
489490 """
490491 Run sp-repo-review.
@@ -519,19 +520,18 @@ def rr_tests(session: nox.Session) -> None:
519520 """
520521 Run the unit and regular tests for sp-repo-review.
521522 """
522- session .install ("-e.[test,cli]" )
523+ pyproject = nox .project .load_toml ()
524+ test_deps = nox .project .dependency_groups (pyproject , "test" )
525+
526+ session .install ("-e.[cli]" , * test_deps )
523527 session .run ("pytest" , * session .posargs , env = {"PYTHONWARNDEFAULTENCODING" : "1" })
524528
525529
526- @nox .session (reuse_venv = True )
530+ @nox .session (reuse_venv = True , default = False )
527531def rr_build (session : nox .Session ) -> None :
528532 """
529533 Build an SDist and wheel for sp-repo-review.
530534 """
531535
532- build_p = DIR .joinpath ("build" )
533- if build_p .exists ():
534- shutil .rmtree (build_p )
535-
536536 session .install ("build" )
537537 session .run ("python" , "-m" , "build" )
0 commit comments