Skip to content

Commit

Permalink
Switch to uv pip compile (#2958)
Browse files Browse the repository at this point in the history
* 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 <132141463+T-256@users.noreply.github.com>

* Trigger CI

---------

Co-authored-by: T-256 <132141463+T-256@users.noreply.github.com>
  • Loading branch information
CoolCat467 and T-256 authored Jul 8, 2024
1 parent fbbfa2c commit 72f5931
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 63 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/autodeps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
run: |
python -m pip install -U pip pre-commit
python -m pip install -r test-requirements.txt
pip-compile -U test-requirements.in
pip-compile -U docs-requirements.in
uv pip compile --no-strip-markers --python-version=3.8 --upgrade test-requirements.in -o test-requirements.txt
uv pip compile --no-strip-markers --python-version=3.8 --upgrade docs-requirements.in -o docs-requirements.txt
pre-commit autoupdate --jobs 0
- name: Black
run: |
Expand Down
4 changes: 2 additions & 2 deletions check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ fi

# Check pip compile is consistent
echo "::group::Pip Compile - Tests"
pip-compile test-requirements.in
uv pip compile --no-strip-markers --python-version=3.8 test-requirements.in -o test-requirements.txt
echo "::endgroup::"
echo "::group::Pip Compile - Docs"
pip-compile docs-requirements.in
uv pip compile --no-strip-markers --python-version=3.8 docs-requirements.in -o docs-requirements.txt
echo "::endgroup::"

if git status --porcelain | grep -q "requirements.txt"; then
Expand Down
22 changes: 9 additions & 13 deletions docs-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# pip-compile docs-requirements.in
#
# This file was autogenerated by uv via the following command:
# uv pip compile --no-strip-markers --python-version=3.8 docs-requirements.in -o docs-requirements.txt
alabaster==0.7.13
# via sphinx
attrs==23.2.0
Expand All @@ -16,7 +12,7 @@ beautifulsoup4==4.12.3
# via sphinx-codeautolink
certifi==2024.7.4
# via requests
cffi==1.16.0
cffi==1.16.0 ; platform_python_implementation != 'PyPy'
# via cryptography
charset-normalizer==3.3.2
# via requests
Expand All @@ -38,9 +34,9 @@ imagesize==1.4.1
# via sphinx
immutables==0.20
# via -r docs-requirements.in
importlib-metadata==8.0.0
importlib-metadata==8.0.0 ; python_version < '3.10'
# via sphinx
importlib-resources==6.4.0
importlib-resources==6.4.0 ; python_version < '3.10'
# via towncrier
incremental==22.10.0
# via towncrier
Expand All @@ -55,13 +51,13 @@ outcome==1.3.0.post0
# via -r docs-requirements.in
packaging==24.1
# via sphinx
pycparser==2.22
pycparser==2.22 ; platform_python_implementation != 'PyPy'
# via cffi
pygments==2.18.0
# via sphinx
pyopenssl==24.1.0
# via -r docs-requirements.in
pytz==2024.1
pytz==2024.1 ; python_version < '3.9'
# via babel
requests==2.32.3
# via sphinx
Expand Down Expand Up @@ -106,13 +102,13 @@ sphinxcontrib-serializinghtml==1.1.5
# via sphinx
sphinxcontrib-trio==1.1.2
# via -r docs-requirements.in
tomli==2.0.1
tomli==2.0.1 ; python_version < '3.11'
# via towncrier
towncrier==23.11.0
# via -r docs-requirements.in
urllib3==2.2.2
# via requests
zipp==3.19.2
zipp==3.19.2 ; python_version < '3.10'
# via
# importlib-metadata
# importlib-resources
2 changes: 1 addition & 1 deletion test-requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ mypy; implementation_name == "cpython"
types-pyOpenSSL; implementation_name == "cpython" # and annotations
ruff >= 0.4.3
astor # code generation
pip-tools >= 6.13.0
uv >= 0.2.22
codespell

# https://github.com/python-trio/trio/pull/654#issuecomment-420518745
Expand Down
67 changes: 22 additions & 45 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# pip-compile test-requirements.in
#
# This file was autogenerated by uv via the following command:
# uv pip compile --no-strip-markers --python-version=3.8 test-requirements.in -o test-requirements.txt
alabaster==0.7.13
# via sphinx
astor==0.8.1
Expand All @@ -18,20 +14,16 @@ attrs==23.2.0
# outcome
babel==2.15.0
# via sphinx
black==24.4.2 ; implementation_name == "cpython"
black==24.4.2 ; implementation_name == 'cpython'
# via -r test-requirements.in
build==1.2.1
# via pip-tools
certifi==2024.7.4
# via requests
cffi==1.17.0rc1
cffi==1.17.0rc1 ; platform_python_implementation != 'PyPy'
# via cryptography
charset-normalizer==3.3.2
# via requests
click==8.1.7
# via
# black
# pip-tools
click==8.1.7 ; implementation_name == 'cpython'
# via black
codespell==2.3.0
# via -r test-requirements.in
coverage==7.5.4
Expand All @@ -42,11 +34,11 @@ cryptography==42.0.8
# pyopenssl
# trustme
# types-pyopenssl
dill==0.3.8
dill==0.3.8 ; python_version < '3.11'
# via pylint
docutils==0.20.1
# via sphinx
exceptiongroup==1.2.1 ; python_version < "3.11"
exceptiongroup==1.2.1 ; python_version < '3.11'
# via
# -r test-requirements.in
# pytest
Expand All @@ -57,10 +49,8 @@ idna==3.7
# trustme
imagesize==1.4.1
# via sphinx
importlib-metadata==8.0.0
# via
# build
# sphinx
importlib-metadata==8.0.0 ; python_version < '3.10'
# via sphinx
iniconfig==2.0.0
# via pytest
isort==5.13.2
Expand All @@ -73,9 +63,9 @@ markupsafe==2.1.5
# via jinja2
mccabe==0.7.0
# via pylint
mypy==1.10.1 ; implementation_name == "cpython"
mypy==1.10.1 ; implementation_name == 'cpython'
# via -r test-requirements.in
mypy-extensions==1.0.0 ; implementation_name == "cpython"
mypy-extensions==1.0.0 ; implementation_name == 'cpython'
# via
# -r test-requirements.in
# black
Expand All @@ -87,38 +77,31 @@ outcome==1.3.0.post0
packaging==24.1
# via
# black
# build
# pytest
# sphinx
parso==0.8.4
# via jedi
pathspec==0.12.1
pathspec==0.12.1 ; implementation_name == 'cpython'
# via black
pip-tools==7.4.1
# via -r test-requirements.in
platformdirs==4.2.2
# via
# black
# pylint
pluggy==1.5.0
# via pytest
pycparser==2.22
pycparser==2.22 ; platform_python_implementation != 'PyPy'
# via cffi
pygments==2.18.0
# via sphinx
pylint==3.2.5
# via -r test-requirements.in
pyopenssl==24.1.0
# via -r test-requirements.in
pyproject-hooks==1.1.0
# via
# build
# pip-tools
pyright==1.1.370
# via -r test-requirements.in
pytest==8.2.2
# via -r test-requirements.in
pytz==2024.1
pytz==2024.1 ; python_version < '3.9'
# via babel
requests==2.32.3
# via sphinx
Expand All @@ -144,27 +127,25 @@ sphinxcontrib-qthelp==1.0.3
# via sphinx
sphinxcontrib-serializinghtml==1.1.5
# via sphinx
tomli==2.0.1
tomli==2.0.1 ; python_version < '3.11' or (python_version < '3.11' and implementation_name == 'cpython')
# via
# black
# build
# mypy
# pip-tools
# pylint
# pytest
tomlkit==0.12.5
# via pylint
trustme==1.1.0
# via -r test-requirements.in
types-cffi==1.16.0.20240331 ; implementation_name == "cpython"
types-cffi==1.16.0.20240331 ; implementation_name == 'cpython'
# via
# -r test-requirements.in
# types-pyopenssl
types-docutils==0.21.0.20240704
# via -r test-requirements.in
types-pyopenssl==24.1.0.20240425 ; implementation_name == "cpython"
types-pyopenssl==24.1.0.20240425 ; implementation_name == 'cpython'
# via -r test-requirements.in
types-setuptools==70.2.0.20240704
types-setuptools==70.2.0.20240704 ; implementation_name == 'cpython'
# via types-cffi
typing-extensions==4.12.2
# via
Expand All @@ -175,11 +156,7 @@ typing-extensions==4.12.2
# pylint
urllib3==2.2.2
# via requests
wheel==0.43.0
# via pip-tools
zipp==3.19.2
uv==0.2.22
# via -r test-requirements.in
zipp==3.19.2 ; python_version < '3.10'
# via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
# pip
# setuptools

0 comments on commit 72f5931

Please sign in to comment.