Skip to content

Commit 72f5931

Browse files
CoolCat467T-256
andauthored
Switch to uv pip compile (#2958)
* Switch to `uv pip compile` * Apply `uv`'s changes * Use `uv pip compile` for autodeps as well * Move uv to test-requirements and fix autodeps updating * Bootstrap `uv` install * Update `test-requrements.txt` * Remove manual pip install uv from autodeps as well * Attempt not including version specifier See #2958 (comment) * Revert "Attempt not including version specifier" This reverts commit 383729f. It did not work. * Fix requirements files * Update dependencies with new version of uv * Use latest commit of uv with `--no-strip-markers` support * Require future version of uv that does not currently exist * Update to uv `0.2.17` * Fix cffi * Apply suggestions from code review Co-authored-by: T-256 <[email protected]> * Trigger CI --------- Co-authored-by: T-256 <[email protected]>
1 parent fbbfa2c commit 72f5931

File tree

5 files changed

+36
-63
lines changed

5 files changed

+36
-63
lines changed

.github/workflows/autodeps.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ jobs:
2828
run: |
2929
python -m pip install -U pip pre-commit
3030
python -m pip install -r test-requirements.txt
31-
pip-compile -U test-requirements.in
32-
pip-compile -U docs-requirements.in
31+
uv pip compile --no-strip-markers --python-version=3.8 --upgrade test-requirements.in -o test-requirements.txt
32+
uv pip compile --no-strip-markers --python-version=3.8 --upgrade docs-requirements.in -o docs-requirements.txt
3333
pre-commit autoupdate --jobs 0
3434
- name: Black
3535
run: |

check.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ fi
7878

7979
# Check pip compile is consistent
8080
echo "::group::Pip Compile - Tests"
81-
pip-compile test-requirements.in
81+
uv pip compile --no-strip-markers --python-version=3.8 test-requirements.in -o test-requirements.txt
8282
echo "::endgroup::"
8383
echo "::group::Pip Compile - Docs"
84-
pip-compile docs-requirements.in
84+
uv pip compile --no-strip-markers --python-version=3.8 docs-requirements.in -o docs-requirements.txt
8585
echo "::endgroup::"
8686

8787
if git status --porcelain | grep -q "requirements.txt"; then

docs-requirements.txt

Lines changed: 9 additions & 13 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.8
3-
# by the following command:
4-
#
5-
# pip-compile docs-requirements.in
6-
#
1+
# This file was autogenerated by uv via the following command:
2+
# uv pip compile --no-strip-markers --python-version=3.8 docs-requirements.in -o docs-requirements.txt
73
alabaster==0.7.13
84
# via sphinx
95
attrs==23.2.0
@@ -16,7 +12,7 @@ beautifulsoup4==4.12.3
1612
# via sphinx-codeautolink
1713
certifi==2024.7.4
1814
# via requests
19-
cffi==1.16.0
15+
cffi==1.16.0 ; platform_python_implementation != 'PyPy'
2016
# via cryptography
2117
charset-normalizer==3.3.2
2218
# via requests
@@ -38,9 +34,9 @@ imagesize==1.4.1
3834
# via sphinx
3935
immutables==0.20
4036
# via -r docs-requirements.in
41-
importlib-metadata==8.0.0
37+
importlib-metadata==8.0.0 ; python_version < '3.10'
4238
# via sphinx
43-
importlib-resources==6.4.0
39+
importlib-resources==6.4.0 ; python_version < '3.10'
4440
# via towncrier
4541
incremental==22.10.0
4642
# via towncrier
@@ -55,13 +51,13 @@ outcome==1.3.0.post0
5551
# via -r docs-requirements.in
5652
packaging==24.1
5753
# via sphinx
58-
pycparser==2.22
54+
pycparser==2.22 ; platform_python_implementation != 'PyPy'
5955
# via cffi
6056
pygments==2.18.0
6157
# via sphinx
6258
pyopenssl==24.1.0
6359
# via -r docs-requirements.in
64-
pytz==2024.1
60+
pytz==2024.1 ; python_version < '3.9'
6561
# via babel
6662
requests==2.32.3
6763
# via sphinx
@@ -106,13 +102,13 @@ sphinxcontrib-serializinghtml==1.1.5
106102
# via sphinx
107103
sphinxcontrib-trio==1.1.2
108104
# via -r docs-requirements.in
109-
tomli==2.0.1
105+
tomli==2.0.1 ; python_version < '3.11'
110106
# via towncrier
111107
towncrier==23.11.0
112108
# via -r docs-requirements.in
113109
urllib3==2.2.2
114110
# via requests
115-
zipp==3.19.2
111+
zipp==3.19.2 ; python_version < '3.10'
116112
# via
117113
# importlib-metadata
118114
# importlib-resources

test-requirements.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ mypy; implementation_name == "cpython"
1515
types-pyOpenSSL; implementation_name == "cpython" # and annotations
1616
ruff >= 0.4.3
1717
astor # code generation
18-
pip-tools >= 6.13.0
18+
uv >= 0.2.22
1919
codespell
2020

2121
# https://github.com/python-trio/trio/pull/654#issuecomment-420518745

test-requirements.txt

Lines changed: 22 additions & 45 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.8
3-
# by the following command:
4-
#
5-
# pip-compile test-requirements.in
6-
#
1+
# This file was autogenerated by uv via the following command:
2+
# uv pip compile --no-strip-markers --python-version=3.8 test-requirements.in -o test-requirements.txt
73
alabaster==0.7.13
84
# via sphinx
95
astor==0.8.1
@@ -18,20 +14,16 @@ attrs==23.2.0
1814
# outcome
1915
babel==2.15.0
2016
# via sphinx
21-
black==24.4.2 ; implementation_name == "cpython"
17+
black==24.4.2 ; implementation_name == 'cpython'
2218
# via -r test-requirements.in
23-
build==1.2.1
24-
# via pip-tools
2519
certifi==2024.7.4
2620
# via requests
27-
cffi==1.17.0rc1
21+
cffi==1.17.0rc1 ; platform_python_implementation != 'PyPy'
2822
# via cryptography
2923
charset-normalizer==3.3.2
3024
# via requests
31-
click==8.1.7
32-
# via
33-
# black
34-
# pip-tools
25+
click==8.1.7 ; implementation_name == 'cpython'
26+
# via black
3527
codespell==2.3.0
3628
# via -r test-requirements.in
3729
coverage==7.5.4
@@ -42,11 +34,11 @@ cryptography==42.0.8
4234
# pyopenssl
4335
# trustme
4436
# types-pyopenssl
45-
dill==0.3.8
37+
dill==0.3.8 ; python_version < '3.11'
4638
# via pylint
4739
docutils==0.20.1
4840
# via sphinx
49-
exceptiongroup==1.2.1 ; python_version < "3.11"
41+
exceptiongroup==1.2.1 ; python_version < '3.11'
5042
# via
5143
# -r test-requirements.in
5244
# pytest
@@ -57,10 +49,8 @@ idna==3.7
5749
# trustme
5850
imagesize==1.4.1
5951
# via sphinx
60-
importlib-metadata==8.0.0
61-
# via
62-
# build
63-
# sphinx
52+
importlib-metadata==8.0.0 ; python_version < '3.10'
53+
# via sphinx
6454
iniconfig==2.0.0
6555
# via pytest
6656
isort==5.13.2
@@ -73,9 +63,9 @@ markupsafe==2.1.5
7363
# via jinja2
7464
mccabe==0.7.0
7565
# via pylint
76-
mypy==1.10.1 ; implementation_name == "cpython"
66+
mypy==1.10.1 ; implementation_name == 'cpython'
7767
# via -r test-requirements.in
78-
mypy-extensions==1.0.0 ; implementation_name == "cpython"
68+
mypy-extensions==1.0.0 ; implementation_name == 'cpython'
7969
# via
8070
# -r test-requirements.in
8171
# black
@@ -87,38 +77,31 @@ outcome==1.3.0.post0
8777
packaging==24.1
8878
# via
8979
# black
90-
# build
9180
# pytest
9281
# sphinx
9382
parso==0.8.4
9483
# via jedi
95-
pathspec==0.12.1
84+
pathspec==0.12.1 ; implementation_name == 'cpython'
9685
# via black
97-
pip-tools==7.4.1
98-
# via -r test-requirements.in
9986
platformdirs==4.2.2
10087
# via
10188
# black
10289
# pylint
10390
pluggy==1.5.0
10491
# via pytest
105-
pycparser==2.22
92+
pycparser==2.22 ; platform_python_implementation != 'PyPy'
10693
# via cffi
10794
pygments==2.18.0
10895
# via sphinx
10996
pylint==3.2.5
11097
# via -r test-requirements.in
11198
pyopenssl==24.1.0
11299
# via -r test-requirements.in
113-
pyproject-hooks==1.1.0
114-
# via
115-
# build
116-
# pip-tools
117100
pyright==1.1.370
118101
# via -r test-requirements.in
119102
pytest==8.2.2
120103
# via -r test-requirements.in
121-
pytz==2024.1
104+
pytz==2024.1 ; python_version < '3.9'
122105
# via babel
123106
requests==2.32.3
124107
# via sphinx
@@ -144,27 +127,25 @@ sphinxcontrib-qthelp==1.0.3
144127
# via sphinx
145128
sphinxcontrib-serializinghtml==1.1.5
146129
# via sphinx
147-
tomli==2.0.1
130+
tomli==2.0.1 ; python_version < '3.11' or (python_version < '3.11' and implementation_name == 'cpython')
148131
# via
149132
# black
150-
# build
151133
# mypy
152-
# pip-tools
153134
# pylint
154135
# pytest
155136
tomlkit==0.12.5
156137
# via pylint
157138
trustme==1.1.0
158139
# via -r test-requirements.in
159-
types-cffi==1.16.0.20240331 ; implementation_name == "cpython"
140+
types-cffi==1.16.0.20240331 ; implementation_name == 'cpython'
160141
# via
161142
# -r test-requirements.in
162143
# types-pyopenssl
163144
types-docutils==0.21.0.20240704
164145
# via -r test-requirements.in
165-
types-pyopenssl==24.1.0.20240425 ; implementation_name == "cpython"
146+
types-pyopenssl==24.1.0.20240425 ; implementation_name == 'cpython'
166147
# via -r test-requirements.in
167-
types-setuptools==70.2.0.20240704
148+
types-setuptools==70.2.0.20240704 ; implementation_name == 'cpython'
168149
# via types-cffi
169150
typing-extensions==4.12.2
170151
# via
@@ -175,11 +156,7 @@ typing-extensions==4.12.2
175156
# pylint
176157
urllib3==2.2.2
177158
# via requests
178-
wheel==0.43.0
179-
# via pip-tools
180-
zipp==3.19.2
159+
uv==0.2.22
160+
# via -r test-requirements.in
161+
zipp==3.19.2 ; python_version < '3.10'
181162
# via importlib-metadata
182-
183-
# The following packages are considered to be unsafe in a requirements file:
184-
# pip
185-
# setuptools

0 commit comments

Comments
 (0)