|
23 | 23 |
|
24 | 24 | BLACK_VERSION = "black==19.10b0"
|
25 | 25 | BLACK_PATHS = ("docs", "google", "samples", "tests", "noxfile.py", "setup.py")
|
| 26 | + |
| 27 | +DEFAULT_PYTHON_VERSION = "3.8" |
| 28 | +SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"] |
| 29 | +UNIT_TEST_PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9"] |
26 | 30 | CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
|
27 | 31 |
|
28 | 32 | # 'docfx' is excluded since it only needs to run in 'docs-presubmit'
|
@@ -80,13 +84,13 @@ def default(session):
|
80 | 84 | )
|
81 | 85 |
|
82 | 86 |
|
83 |
| -@nox.session(python=["3.6", "3.7", "3.8"]) |
| 87 | +@nox.session(python=UNIT_TEST_PYTHON_VERSIONS) |
84 | 88 | def unit(session):
|
85 | 89 | """Run the unit test suite."""
|
86 | 90 | default(session)
|
87 | 91 |
|
88 | 92 |
|
89 |
| -@nox.session(python=["3.8"]) |
| 93 | +@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS) |
90 | 94 | def system(session):
|
91 | 95 | """Run the system test suite."""
|
92 | 96 |
|
@@ -118,7 +122,7 @@ def system(session):
|
118 | 122 | session.run("py.test", "--quiet", os.path.join("tests", "system"), *session.posargs)
|
119 | 123 |
|
120 | 124 |
|
121 |
| -@nox.session(python=["3.8"]) |
| 125 | +@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS) |
122 | 126 | def snippets(session):
|
123 | 127 | """Run the snippets test suite."""
|
124 | 128 |
|
@@ -154,7 +158,7 @@ def snippets(session):
|
154 | 158 | )
|
155 | 159 |
|
156 | 160 |
|
157 |
| -@nox.session(python="3.8") |
| 161 | +@nox.session(python=DEFAULT_PYTHON_VERSION) |
158 | 162 | def cover(session):
|
159 | 163 | """Run the final coverage report.
|
160 | 164 |
|
@@ -166,7 +170,7 @@ def cover(session):
|
166 | 170 | session.run("coverage", "erase")
|
167 | 171 |
|
168 | 172 |
|
169 |
| -@nox.session(python="3.8") |
| 173 | +@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS) |
170 | 174 | def prerelease_deps(session):
|
171 | 175 | """Run all tests with prerelease versions of dependencies installed.
|
172 | 176 |
|
@@ -201,7 +205,7 @@ def prerelease_deps(session):
|
201 | 205 | session.run("py.test", "samples/tests")
|
202 | 206 |
|
203 | 207 |
|
204 |
| -@nox.session(python="3.8") |
| 208 | +@nox.session(python=DEFAULT_PYTHON_VERSION) |
205 | 209 | def lint(session):
|
206 | 210 | """Run linters.
|
207 | 211 |
|
@@ -218,7 +222,7 @@ def lint(session):
|
218 | 222 | session.run("black", "--check", *BLACK_PATHS)
|
219 | 223 |
|
220 | 224 |
|
221 |
| -@nox.session(python="3.8") |
| 225 | +@nox.session(python=DEFAULT_PYTHON_VERSION) |
222 | 226 | def lint_setup_py(session):
|
223 | 227 | """Verify that setup.py is valid (including RST check)."""
|
224 | 228 |
|
@@ -239,7 +243,7 @@ def blacken(session):
|
239 | 243 | session.run("black", *BLACK_PATHS)
|
240 | 244 |
|
241 | 245 |
|
242 |
| -@nox.session(python="3.8") |
| 246 | +@nox.session(python=DEFAULT_PYTHON_VERSION) |
243 | 247 | def docs(session):
|
244 | 248 | """Build the docs."""
|
245 | 249 |
|
@@ -262,7 +266,7 @@ def docs(session):
|
262 | 266 | )
|
263 | 267 |
|
264 | 268 |
|
265 |
| -@nox.session(python="3.8") |
| 269 | +@nox.session(python=DEFAULT_PYTHON_VERSION) |
266 | 270 | def docfx(session):
|
267 | 271 | """Build the docfx yaml files for this library."""
|
268 | 272 |
|
|
0 commit comments