|
12 | 12 | docs=DOCS / "requirements.txt", |
13 | 13 | ) |
14 | 14 | REQUIREMENTS_IN = [ # this is actually ordered, as files depend on each other |
15 | | - path.parent / f"{path.stem}.in" for path in REQUIREMENTS.values() |
| 15 | + (path.parent / f"{path.stem}.in", path) for path in REQUIREMENTS.values() |
16 | 16 | ] |
17 | 17 |
|
18 | | -SUPPORTED = ["3.11", "3.12"] |
19 | | -LATEST = "3.12" |
| 18 | +SUPPORTED = ["3.11", "3.12", "3.13"] |
| 19 | +LATEST = SUPPORTED[-1] |
20 | 20 |
|
| 21 | +nox.options.default_venv_backend = "uv|virtualenv" |
21 | 22 | nox.options.sessions = [] |
22 | 23 |
|
23 | 24 |
|
@@ -130,15 +131,17 @@ def docs_style(session): |
130 | 131 | @session(default=False) |
131 | 132 | def requirements(session): |
132 | 133 | """ |
133 | | - Update the project's pinned requirements. Commit the result. |
| 134 | + Update the project's pinned requirements. |
| 135 | +
|
| 136 | + You should commit the result afterwards. |
134 | 137 | """ |
135 | | - session.install("pip-tools") |
136 | | - for each in REQUIREMENTS_IN: |
137 | | - session.run( |
138 | | - "pip-compile", |
139 | | - "--resolver", |
140 | | - "backtracking", |
141 | | - "--strip-extras", |
142 | | - "-U", |
143 | | - each.relative_to(ROOT), |
144 | | - ) |
| 138 | + if session.venv_backend == "uv": |
| 139 | + cmd = ["uv", "pip", "compile"] |
| 140 | + else: |
| 141 | + session.install("pip-tools") |
| 142 | + cmd = ["pip-compile", "--resolver", "backtracking", "--strip-extras"] |
| 143 | + |
| 144 | + for each, out in REQUIREMENTS_IN: |
| 145 | + # otherwise output files end up with silly absolute path comments... |
| 146 | + relative = each.relative_to(ROOT) |
| 147 | + session.run(*cmd, "--upgrade", "--output-file", out, relative) |
0 commit comments