|
23 | 23 | nox.options.default_venv_backend = "venv" |
24 | 24 | nox.options.reuse_existing_virtualenvs = True |
25 | 25 |
|
| 26 | +os.environ.update({"PDM_IGNORE_SAVED_PYTHON": "1"}) |
| 27 | + |
26 | 28 | PACKAGE_NAME = "django_registration" |
27 | 29 |
|
28 | 30 | NOXFILE_PATH = pathlib.Path(__file__).parents[0] |
@@ -57,21 +59,22 @@ def clean(paths: typing.Iterable[pathlib.Path] = ARTIFACT_PATHS) -> None: |
57 | 59 | @nox.parametrize( |
58 | 60 | "python,django", |
59 | 61 | [ |
60 | | - # Python/Django testing matrix. Tests Django 4.2, 5.0, 5.1 on Python 3.8 through |
| 62 | + # Python/Django testing matrix. Tests Django 4.2, 5.0, 5.1 on Python 3.9 through |
61 | 63 | # 3.12, skipping unsupported combinations. |
62 | 64 | (python, django) |
63 | | - for python in ["3.8", "3.9", "3.10", "3.11", "3.12"] |
| 65 | + for python in ["3.9", "3.10", "3.11", "3.12", "3.13"] |
64 | 66 | for django in ["4.2", "5.0", "5.1"] |
65 | 67 | if (python, django) |
66 | | - not in [("3.8", "5.0"), ("3.9", "5.0"), ("3.8", "5.1"), ("3.9", "5.1")] |
| 68 | + not in [("3.9", "5.0"), ("3.9", "5.1"), ("3.13", "4.2"), ("3.13", "5.0")] |
67 | 69 | ], |
68 | 70 | ) |
69 | 71 | def tests_with_coverage(session: nox.Session, django: str) -> None: |
70 | 72 | """ |
71 | 73 | Run the package's unit tests, with coverage report. |
72 | 74 |
|
73 | 75 | """ |
74 | | - session.install(f"Django~={django}.0", ".[tests]") |
| 76 | + session.install(f"Django~={django}.0") |
| 77 | + session.run_always("pdm", "install", "-dG", "tests", external=True) |
75 | 78 | python_version = session.run( |
76 | 79 | f"{session.bin}/python{session.python}", "--version", silent=True |
77 | 80 | ).strip() |
@@ -115,18 +118,21 @@ def docs_build(session: nox.Session) -> None: |
115 | 118 | Build the package's documentation as HTML. |
116 | 119 |
|
117 | 120 | """ |
118 | | - session.install(".[docs]") |
119 | | - session.chdir("docs") |
| 121 | + session.run_always("pdm", "install", "-dG", "docs", external=True) |
| 122 | + build_dir = session.create_tmp() |
120 | 123 | session.run( |
121 | 124 | f"{session.bin}/python{session.python}", |
122 | 125 | "-Im", |
123 | 126 | "sphinx", |
124 | | - "-b", |
| 127 | + "--builder", |
125 | 128 | "html", |
126 | | - "-d", |
127 | | - f"{session.bin}/../tmp/doctrees", |
128 | | - ".", |
129 | | - f"{session.bin}/../tmp/html", |
| 129 | + "--write-all", |
| 130 | + "-c", |
| 131 | + "docs/", |
| 132 | + "--doctree-dir", |
| 133 | + f"{build_dir}/doctrees", |
| 134 | + "docs/", |
| 135 | + f"{build_dir}/html", |
130 | 136 | ) |
131 | 137 | clean() |
132 | 138 |
|
@@ -160,19 +166,21 @@ def docs_spellcheck(session: nox.Session) -> None: |
160 | 166 | Spell-check the package's documentation. |
161 | 167 |
|
162 | 168 | """ |
163 | | - session.install("pyenchant", "sphinxcontrib-spelling", ".[docs]") |
| 169 | + session.run_always("pdm", "install", "-dG", "docs", external=True) |
| 170 | + session.install("pyenchant", "sphinxcontrib-spelling") |
164 | 171 | build_dir = session.create_tmp() |
165 | | - session.chdir("docs") |
166 | 172 | session.run( |
167 | 173 | f"{session.bin}/python{session.python}", |
168 | 174 | "-Im", |
169 | 175 | "sphinx", |
170 | 176 | "-W", # Promote warnings to errors, so that misspelled words fail the build. |
171 | | - "-b", |
| 177 | + "--builder", |
172 | 178 | "spelling", |
173 | | - "-d", |
| 179 | + "-c", |
| 180 | + "docs/", |
| 181 | + "--doctree-dir", |
174 | 182 | f"{build_dir}/doctrees", |
175 | | - ".", |
| 183 | + "docs/", |
176 | 184 | f"{build_dir}/html", |
177 | 185 | # On Apple Silicon Macs, this environment variable needs to be set so |
178 | 186 | # pyenchant can find the "enchant" C library. See |
@@ -281,12 +289,12 @@ def lint_flake8(session: nox.Session) -> None: |
281 | 289 | @nox.session(python=["3.12"], tags=["linters"]) |
282 | 290 | def lint_pylint(session: nox.Session) -> None: |
283 | 291 | """ |
284 | | - Lint code with Pyling. |
| 292 | + Lint code with Pylint. |
285 | 293 |
|
286 | 294 | """ |
287 | 295 | # Pylint requires that all dependencies be importable during the run, so unlike |
288 | 296 | # other lint tasks we just install the package. |
289 | | - session.install(".") |
| 297 | + session.run_always("pdm", "install", "-dG", "tests", external=True) |
290 | 298 | session.install("pylint", "pylint-django") |
291 | 299 | session.run(f"python{session.python}", "-Im", "pylint", "--version") |
292 | 300 | session.run(f"python{session.python}", "-Im", "pylint", "src/", "tests/") |
|
0 commit comments