@@ -26,10 +26,11 @@ import nox
26
26
BLACK_VERSION = "black==19.3b0"
27
27
BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]
28
28
29
- if os.path.exists("samples"):
30
- BLACK_PATHS.append("samples")
29
+ DEFAULT_PYTHON_VERSION="{{ default_python_version }}"
30
+ SYSTEM_TEST_PYTHON_VERSIONS=[{% for v in system_test_python_versions %} "{{v}}"{% if not loop .last %} ,{% endif %}{% endfor %} ]
31
+ UNIT_TEST_PYTHON_VERSIONS=[{% for v in unit_test_python_versions %} "{{v}}"{% if not loop .last %} ,{% endif %}{% endfor %} ]
31
32
32
- @nox.session(python="3.7" )
33
+ @nox.session(python=DEFAULT_PYTHON_VERSION )
33
34
def lint(session):
34
35
"""Run linters.
35
36
@@ -62,7 +63,7 @@ def blacken(session):
62
63
)
63
64
64
65
65
- @nox.session(python="3.7" )
66
+ @nox.session(python=DEFAULT_PYTHON_VERSION )
66
67
def lint_setup_py(session):
67
68
"""Verify that setup.py is valid (including RST check)."""
68
69
session.install("docutils", "pygments")
@@ -90,14 +91,13 @@ def default(session):
90
91
*session.posargs,
91
92
)
92
93
93
-
94
- @nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"])
94
+ @nox.session(python=UNIT_TEST_PYTHON_VERSIONS)
95
95
def unit(session):
96
96
"""Run the unit test suite."""
97
97
default(session)
98
98
99
99
100
- @nox.session(python=["2.7", "3.7"] )
100
+ @nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS )
101
101
def system(session):
102
102
"""Run the system test suite."""
103
103
system_test_path = os.path.join("tests", "system.py")
@@ -149,7 +149,7 @@ def samples(session):
149
149
session.run("py.test", "--quiet", "samples", *session.posargs)
150
150
{% endif %}
151
151
152
- @nox.session(python="3.7" )
152
+ @nox.session(python=DEFAULT_PYTHON_VERSION )
153
153
def cover(session):
154
154
"""Run the final coverage report.
155
155
@@ -161,7 +161,7 @@ def cover(session):
161
161
162
162
session.run("coverage", "erase")
163
163
164
- @nox.session(python="3.7" )
164
+ @nox.session(python=DEFAULT_PYTHON_VERSION )
165
165
def docs(session):
166
166
"""Build the docs for this library."""
167
167
0 commit comments