2121import nox
2222
2323
24+ # This is the last version to support Python 2.7
25+ BLACK_VERSION = "black==21.12b0"
26+ DEFAULT_PYTHON_VERSION = "3.8"
27+
28+ # Error if a python version is missing
29+ nox .options .error_on_missing_interpreters = True
30+
2431UNIT_TEST_DEPS = (
2532 'mock' ,
2633 'pytest' ,
3138)
3239
3340
34- @nox .session (python = "3.7" )
41+ @nox .session (python = DEFAULT_PYTHON_VERSION )
3542def lint (session ):
3643 """Run linters.
3744
@@ -49,7 +56,7 @@ def lint(session):
4956 session .run ("flake8" , "google" , "tests" )
5057
5158
52- @nox .session (python = "3.6" )
59+ @nox .session (python = DEFAULT_PYTHON_VERSION )
5360def blacken (session ):
5461 """Run black.
5562
@@ -64,7 +71,7 @@ def blacken(session):
6471 )
6572
6673
67- @nox .session (python = "3.7" )
74+ @nox .session (python = DEFAULT_PYTHON_VERSION )
6875def lint_setup_py (session ):
6976 """Verify that setup.py is valid (including RST check)."""
7077 session .install ("docutils" , "pygments" )
@@ -97,7 +104,7 @@ def default(session, django_dep=('django',)):
97104 )
98105
99106
100- @nox .session (python = ['2.7' , '3.5 ' , '3.6 ' , '3.7 ' ])
107+ @nox .session (python = ['2.7' , '3.6 ' , '3.7 ' , '3.8 ' ])
101108def unit (session ):
102109 """Run the unit test suite."""
103110
@@ -114,7 +121,7 @@ def unit(session):
114121 default (session )
115122
116123
117- @nox .session (python = ['2.7' , '3.6 ' ])
124+ @nox .session (python = ['2.7' , '3.8 ' ])
118125def system (session ):
119126 """Run the system test suite."""
120127
@@ -148,7 +155,7 @@ def system(session):
148155 * session .posargs )
149156
150157
151- @nox .session (python = "3.7" )
158+ @nox .session (python = DEFAULT_PYTHON_VERSION )
152159def cover (session ):
153160 """Run the final coverage report.
154161
@@ -160,12 +167,12 @@ def cover(session):
160167
161168 session .run ("coverage" , "erase" )
162169
163- @nox .session (python = "3.7" )
170+ @nox .session (python = DEFAULT_PYTHON_VERSION )
164171def docs (session ):
165172 """Build the docs for this library."""
166173
167174 session .install ("-e" , "." )
168- session .install ("sphinx<3.0.0" , "alabaster" , "recommonmark" )
175+ session .install ("sphinx<3.0.0" , "jinja2<3.1" , " alabaster" , "recommonmark" )
169176
170177 shutil .rmtree (os .path .join ("docs" , "_build" ), ignore_errors = True )
171178 session .run (
0 commit comments