8000 Use uv for envs, particularly the requirements env. · python-jsonschema/referencing@d031bce · GitHub
[go: up one dir, main page]

Skip to content

Commit d031bce

Browse files
committed
Use uv for envs, particularly the requirements env.
Faster, etc.
1 parent 33a6ccf commit d031bce

File tree

3 files changed

+31
-51
lines changed

3 files changed

+31
-51
lines changed

docs/requirements.txt

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
#
2-
# This file is autogenerated by pip-compile with Python 3.12
3-
# by the following command:
4-
#
5-
# pip-compile --strip-extras docs/requirements.in
6-
#
1+
# This file was autogenerated by uv via the following command:
2+
# uv pip compile --output-file docs/requirements.txt docs/requirements.in
73
alabaster==0.7.16
84
# via sphinx
95
attrs==23.2.0
@@ -16,21 +12,20 @@ certifi==2024.2.2
1612
# via requests
1713
charset-normalizer==3.3.2
1814
# via requests
19-
docutils==0.20.1
15+
docutils==0.21.1
2016
# via sphinx
2117
furo==2024.1.29
22-
# via -r docs/requirements.in
23-
idna==3.6
18+
idna==3.7
2419
# via requests
2520
imagesize==1.4.1
2621
# via sphinx
2722
jinja2==3.1.3
2823
# via sphinx
29-
lxml==5.1.0
24+
lxml==5.2.1
3025
# via sphinx-json-schema-spec
3126
markupsafe==2.1.5
3227
# via jinja2
33-
packaging==23.2
28+
packaging==24.0
3429
# via sphinx
3530
pyenchant==3.2.2
3631
# via sphinxcontrib-spelling
@@ -40,20 +35,17 @@ pygments==2.17.2
4035
# pygments-github-lexers
4136
# sphinx
4237
pygments-github-lexers==0.0.5
43-
# via -r docs/requirements.in
44-
file:.#egg=referencing
45-
# via -r docs/requirements.in
38+
referencing @ file:.#egg=referencing
4639
requests==2.31.0
4740
# via sphinx
48-
rpds-py==0.17.1
41+
rpds-py==0.18.0
4942
# via referencing
5043
snowballstemmer==2.2.0
5144
# via sphinx
5245
soupsieve==2.5
5346
# via beautifulsoup4
54-
sphinx==7.2.6
47+
sphinx==7.3.7
5548
# via
56-
# -r docs/requirements.in
5749
# furo
5850
# sphinx-basic-ng
5951
# sphinx-copybutton
@@ -63,9 +55,7 @@ sphinx==7.2.6
6355
sphinx-basic-ng==1.0.0b2
6456
# via furo
6557
sphinx-copybutton==0.5.2
66-
# via -r docs/requirements.in
6758
sphinx-json-schema-spec==2024.1.1
68-
# via -r docs/requirements.in
6959
sphinxcontrib-applehelp==1.0.8
7060
# via sphinx
7161
sphinxcontrib-devhelp==1.0.6
@@ -79,10 +69,7 @@ sphinxcontrib-qthelp==1.0.7
7969
sphinxcontrib-serializinghtml==1.1.10
8070
# via sphinx
8171
sphinxcontrib-spelling==8.0.0
82-
# via -r docs/requirements.in
8372
sphinxext-opengraph==0.9.1
84-
# via -r docs/requirements.in
8573
url-py==0.10.0
86-
# via -r docs/requirements.in
87-
urllib3==2.2.0
74+
urllib3==2.2.1
8875
# via requests

noxfile.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@
1414
tests=ROOT / "test-requirements.txt",
1515
)
1616
REQUIREMENTS_IN = [ # this is actually ordered, as files depend on each other
17-
path.parent / f"{path.stem}.in" for path in REQUIREMENTS.values()
17+
(path.parent / f"{path.stem}.in", path) for path in REQUIREMENTS.values()
1818
]
1919

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

@@ -167,13 +168,13 @@ def requirements(session):
167168
168169
You should commit the result afterwards.
169170
"""
170-
session.install("pip-tools")
171-
for each in REQUIREMENTS_IN:
172-
session.run(
173-
"pip-compile",
174-
"--resolver",
175-
"backtracking",
176-
"--strip-extras",
177-
"-U",
178-
each.relative_to(ROOT),
179-
)
171+
if session.venv_backend == "uv":
172+
cmd = ["uv", "pip", "compile"]
173+
else:
174+
session.install("pip-tools")
175+
cmd = ["pip-compile", "--resolver", "backtracking", "--strip-extras"]
176+
177+
for each, out in REQUIREMENTS_IN:
178+
# otherwise output files end up with silly absolute path comments...
179+
relative = each.relative_to(ROOT)
180+
session.run(*cmd, "--upgrade", "--output-file", out, relative)

test-requirements.txt

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,18 @@
1-
#
2-
# This file is autogenerated by pip-compile with Python 3.12
3-
# by the following command:
4-
#
5-
# pip-compile --strip-extras test-requirements.in
6-
#
1+
# This file was autogenerated by uv via the following command:
2+
# uv pip compile --output-file test-requirements.txt test-requirements.in
73
attrs==23.2.0
84
# via
95
# pytest-subtests
106
# referencing
117
iniconfig==2.0.0
128
# via pytest
13-
packaging==23.2
9+
packaging==24.0
1410
# via pytest
15-
pluggy==1.4.0
11+
pluggy==1.5.0
1612
# via pytest
17-
pytest==8.0.0
18-
# via
19-
# -r test-requirements.in
20-
# pytest-subtests
21-
pytest-subtests==0.11.0
22-
# via -r test-requirements.in
23-
file:.#egg=referencing
24-
# via -r test-requirements.in
25-
rpds-py==0.17.1
13+
pytest==8.1.1
14+
# via pytest-subtests
15+
pytest-subtests==0.12.1
16+
referencing @ file:.#egg=referencing
17+
rpds-py==0.18.0
2618
# via referencing

0 commit comments

Comments
 (0)
0