|
18 | 18 | import nox |
19 | 19 |
|
20 | 20 | DEFAULT_PYTHON_VERSION = "3.14" |
21 | | -ALL_PYTHON = ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] |
| 21 | +ALL_PYTHON = ["3.10", "3.11", "3.12", "3.13", "3.14"] |
22 | 22 | CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() |
23 | 23 | REPO_ROOT = CURRENT_DIRECTORY.parent.parent |
24 | 24 |
|
|
30 | 30 |
|
31 | 31 | nox.options.sessions = [ |
32 | 32 | "lint", |
| 33 | + "lint_setup_py", |
33 | 34 | "unit", |
| 35 | + "mypy", |
34 | 36 | "prerelease_deps", |
35 | 37 | "core_deps_from_source", |
36 | 38 | "docfx", |
|
39 | 41 | # Error if a python version is missing |
40 | 42 | nox.options.error_on_missing_interpreters = True |
41 | 43 |
|
| 44 | +@nox.session(python=DEFAULT_PYTHON_VERSION) |
| 45 | +def lint_setup_py(session): |
| 46 | + """Verify that setup.py is valid.""" |
| 47 | + session.install("setuptools") |
| 48 | + session.run("python", "setup.py", "check", "--strict") |
| 49 | + |
42 | 50 | @nox.session(python=ALL_PYTHON) |
43 | 51 | def unit(session): |
44 | 52 | """Run unit tests.""" |
45 | 53 | session.install("pytest", "pytest-cov") |
46 | 54 | session.install("-e", ".") |
47 | 55 | session.run("pytest", "tests") |
48 | 56 |
|
| 57 | +@nox.session(python=DEFAULT_PYTHON_VERSION) |
| 58 | +def mypy(session): |
| 59 | + """Run mypy.""" |
| 60 | + session.install("mypy", "types-PyYAML") |
| 61 | + session.install("-e", ".") |
| 62 | + session.run("mypy", "help", "tests", "noxfile.py", "docfx_helper.py") |
| 63 | + |
49 | 64 | @nox.session(python=DEFAULT_PYTHON_VERSION) |
50 | 65 | def prerelease_deps(session): |
51 | 66 | """Run unit tests with prerelease dependencies.""" |
|
0 commit comments