1313COVERAGE_FAIL_UNDER = 50
1414DEFAULT_PYTHON = "3.12"
1515PYTHON_MATRIX = ["3.9" , "3.10" , "3.11" , "3.12" , "3.13" ]
16- VENV_BACKEND = "venv"
1716VENV_PATH = ".venv"
1817REQUIREMENTS_PATH = "./requirements"
1918
3231 "./**/*.pyo" ,
3332]
3433
35-
3634# Define the default sessions run when `nox` is called on the CLI
35+ nox .options .default_venv_backend = "uv|virtualenv"
3736nox .options .sessions = [
3837 "version_coverage" ,
3938 "coverage_combine" ,
@@ -73,7 +72,7 @@ def dev(session: nox.Session) -> None:
7372 session .log (f"\n \n Run '{ activate_command } ' to enter the virtual environment.\n " )
7473
7574
76- @nox .session (python = PYTHON_MATRIX , venv_backend = VENV_BACKEND )
75+ @nox .session (python = PYTHON_MATRIX )
7776def version_coverage (session : nox .Session ) -> None :
7877 """Run unit tests with coverage saved to partial file."""
7978 print_standard_logs (session )
@@ -84,7 +83,7 @@ def version_coverage(session: nox.Session) -> None:
8483 session .run ("coverage" , "run" , "-p" , "-m" , "pytest" , TESTS_PATH )
8584
8685
87- @nox .session (python = DEFAULT_PYTHON , venv_backend = VENV_BACKEND )
86+ @nox .session (python = DEFAULT_PYTHON )
8887def coverage_combine (session : nox .Session ) -> None :
8988 """Combine all coverage partial files and generate JSON report."""
9089 print_standard_logs (session )
@@ -99,7 +98,7 @@ def coverage_combine(session: nox.Session) -> None:
9998 session .run ("python" , "-m" , "coverage" , "json" )
10099
101100
102- @nox .session (python = DEFAULT_PYTHON , venv_backend = VENV_BACKEND )
101+ @nox .session (python = DEFAULT_PYTHON )
103102def mypy (session : nox .Session ) -> None :
104103 """Run mypy against package and all required dependencies."""
105104 print_standard_logs (session )
@@ -110,15 +109,15 @@ def mypy(session: nox.Session) -> None:
110109 session .run ("mypy" , "-p" , MODULE_NAME , "--no-incremental" )
111110
112111
113- @nox .session (python = False , venv_backend = VENV_BACKEND )
112+ @nox .session (python = False )
114113def coverage (session : nox .Session ) -> None :
115114 """Generate a coverage report. Does not use a venv."""
116115 session .run ("coverage" , "erase" )
117116 session .run ("coverage" , "run" , "-m" , "pytest" , TESTS_PATH )
118117 session .run ("coverage" , "report" , "-m" )
119118
120119
121- @nox .session (python = DEFAULT_PYTHON , venv_backend = VENV_BACKEND )
120+ @nox .session (python = DEFAULT_PYTHON )
122121def build (session : nox .Session ) -> None :
123122 """Build distribution files."""
124123 print_standard_logs (session )
@@ -127,7 +126,7 @@ def build(session: nox.Session) -> None:
127126 session .run ("python" , "-m" , "build" )
128127
129128
130- @nox .session (python = DEFAULT_PYTHON , venv_backend = VENV_BACKEND , name = "update-deps" )
129+ @nox .session (python = DEFAULT_PYTHON , name = "update-deps" )
131130def update_deps (session : nox .Session ) -> None :
132131 """Process requirement*.txt files, updating only additions/removals."""
133132 print_standard_logs (session )
@@ -145,7 +144,7 @@ def update_deps(session: nox.Session) -> None:
145144 )
146145
147146
148- @nox .session (python = DEFAULT_PYTHON , venv_backend = VENV_BACKEND , name = "upgrade-deps" )
147+ @nox .session (python = DEFAULT_PYTHON , name = "upgrade-deps" )
149148def upgrade_deps (session : nox .Session ) -> None :
150149 """Process requirement*.txt files and upgrade all libraries as possible."""
151150 print_standard_logs (session )
@@ -164,7 +163,7 @@ def upgrade_deps(session: nox.Session) -> None:
164163 )
165164
166165
167- @nox .session (python = False , venv_backend = VENV_BACKEND )
166+ @nox .session (python = False )
168167def clean (_ : nox .Session ) -> None :
169168 """Clean cache, .pyc, .pyo, and test/build artifact files from project."""
170169 count = 0
0 commit comments