Skip to content

Commit 47a12b6

Browse files
committed
Use uv for envs, particularly the requirements env.
Faster, etc.
1 parent 35fdc41 commit 47a12b6

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

noxfile.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
SUPPORTED = ["3.8", "3.9", "3.10", "pypy3.10", "3.11", "3.12"]
2121
LATEST = SUPPORTED[-1]
2222

23+
nox.options.default_venv_backend = "uv|virtualenv"
2324
nox.options.sessions = []
2425

2526

@@ -162,13 +163,11 @@ def requirements(session):
162163
163164
You should commit the result afterwards.
164165
"""
165-
session.install("pip-tools")
166+
if session.venv_backend == "uv":
167+
cmd = ["uv", "pip", "compile"]
168+
else:
169+
session.install("pip-tools")
170+
cmd = ["pip-compile", "--resolver", "backtracking", "--strip-extras"]
171+
166172
for each in REQUIREMENTS_IN:
167-
session.run(
168-
"pip-compile",
169-
"--resolver",
170-
"backtracking",
171-
"--strip-extras",
172-
"-U",
173-
each.relative_to(ROOT),
174-
)
173+
session.run(*cmd, "-U", each.relative_to(ROOT))

0 commit comments

Comments
 (0)