Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to uv pip compile #2958

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f71fe81
Switch to `uv pip compile`
CoolCat467 Feb 16, 2024
6738ce4
Apply `uv`'s changes
CoolCat467 Feb 16, 2024
76d8326
Fix two lines I missed
CoolCat467 Feb 16, 2024
9f597e0
Use `uv pip compile` for autodeps as well
CoolCat467 Feb 16, 2024
a20b4ce
Move uv to test-requirements and fix autodeps updateing
CoolCat467 Feb 16, 2024
6c8d62b
Bootstrap `uv` install
CoolCat467 Feb 16, 2024
876d6a5
Update `test-requrements.txt`
CoolCat467 Feb 16, 2024
69b5868
Remove manual pip install uv from autodeps as well
CoolCat467 Feb 16, 2024
7f211e5
Update uv version to 0.1.3
CoolCat467 Feb 17, 2024
a0a8b5a
Merge branch 'master' into pip-compile-switch-uv
CoolCat467 Feb 20, 2024
4225702
Update `uv` to `0.1.6`
CoolCat467 Feb 22, 2024
6747417
Apply `uv`'s changes
CoolCat467 Feb 22, 2024
383729f
Attempt not including version specifier
CoolCat467 Feb 22, 2024
72e3fbd
Merge branch 'master' into pip-compile-switch-uv
CoolCat467 Feb 22, 2024
e5277f0
Revert "Attempt not including version specifier"
CoolCat467 Feb 22, 2024
d75ef85
Update `uv` to `0.1.11`
CoolCat467 Feb 27, 2024
283e27b
Merge branch 'master' into pip-compile-switch-uv
CoolCat467 Feb 29, 2024
148a995
Merge branch 'master' into pip-compile-switch-uv
CoolCat467 Mar 3, 2024
1b95b71
Update to `uv 0.1.13`
CoolCat467 Mar 3, 2024
7759de8
Update to uv to 0.1.17
CoolCat467 Mar 11, 2024
199160e
Merge branch 'python-trio:master' into pip-compile-switch-uv
CoolCat467 Mar 11, 2024
bb73318
Merge branch 'master' into pip-compile-switch-uv
CoolCat467 Mar 29, 2024
42eceae
Update to uv `0.1.26`
CoolCat467 Mar 29, 2024
4f1438d
Merge branch 'master' into pip-compile-switch-uv
CoolCat467 Apr 13, 2024
1748ca9
Fix requirements files
CoolCat467 Apr 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
python -m pip install -r test-requirements.txt
pip-compile -U test-requirements.in
pip-compile -U docs-requirements.in
uv pip compile --upgrade test-requirements.in -o test-requirements.txt
uv pip compile --upgrade docs-requirements.in -o docs-requirements.txt
- name: Black
run: |
# The new dependencies may contain a new black version.
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 --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 --python-version=3.8 docs-requirements.in -o docs-requirements.txt
echo "::endgroup::"

if git status --porcelain | grep -q "requirements.txt"; then
Expand Down
31 changes: 5 additions & 26 deletions docs-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
#
# 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 v0.1.1 via the following command:
# uv pip compile --python-version=3.8 docs-requirements.in -o docs-requirements.txt
alabaster==0.7.13
# via sphinx
attrs==23.2.0
# via
# -r docs-requirements.in
# outcome
# via outcome
babel==2.14.0
# via sphinx
certifi==2024.2.2
Expand All @@ -27,15 +21,11 @@ docutils==0.20.1
# sphinx
# sphinx-rtd-theme
exceptiongroup==1.2.0
# via -r docs-requirements.in
idna==3.6
# via
# -r docs-requirements.in
# requests
# via requests
imagesize==1.4.1
# via sphinx
immutables==0.20
# via -r docs-requirements.in
importlib-metadata==7.0.1
# via sphinx
importlib-resources==6.1.1
Expand All @@ -44,61 +34,50 @@ incremental==22.10.0
# via towncrier
jinja2==3.1.3
# via
# -r docs-requirements.in
# sphinx
# towncrier
markupsafe==2.1.5
# via jinja2
outcome==1.3.0.post0
# via -r docs-requirements.in
packaging==23.2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these expected? or missing compatibility from uv?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uv doesn't appear to explicitly list the fact a dependency is requested from the .in file, which kind of makes sense. If nothing is listed as a what required that module, why waste text? It also makes it more immediately clear when something is a requirement of another package.

Additionally, uv hasn't explicitly said that they are trying to have 100% compatibility for these compiled files, and I personally am for this particular change differing from pip-compile.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If nothing is listed as a what required that module, why waste text?

It'd make senses when multiple .in passed for single output.
Also, it'd be increasing readability for recognizing top-level requirements.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@charliermarsh Do you think this is compatibility problem and need to open issue for it? or this is by design/not planned?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvm. found the issue: astral-sh/uv#1343

# via sphinx
pycparser==2.21
# via cffi
pygments==2.17.2
# via sphinx
pyopenssl==24.0.0
# via -r docs-requirements.in
pytz==2024.1
# via babel
requests==2.31.0
# via sphinx
sniffio==1.3.0
# via -r docs-requirements.in
snowballstemmer==2.2.0
# via sphinx
sortedcontainers==2.4.0
# via -r docs-requirements.in
sphinx==7.1.2
# via
# -r docs-requirements.in
# sphinx-rtd-theme
# sphinxcontrib-jquery
# sphinxcontrib-trio
sphinx-rtd-theme==2.0.0
# via -r docs-requirements.in
sphinxcontrib-applehelp==1.0.4
# via sphinx
sphinxcontrib-devhelp==1.0.2
# via sphinx
sphinxcontrib-htmlhelp==2.0.1
# via sphinx
sphinxcontrib-jquery==4.1
# via
# -r docs-requirements.in
# sphinx-rtd-theme
# via sphinx-rtd-theme
sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-qthelp==1.0.3
# via sphinx
sphinxcontrib-serializinghtml==1.1.5
# via sphinx
sphinxcontrib-trio==1.1.2
# via -r docs-requirements.in
tomli==2.0.1
# via towncrier
towncrier==23.11.0
# via -r docs-requirements.in
urllib3==2.2.0
# via requests
zipp==3.17.0
Expand Down
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.1.5
astor # code generation
pip-tools >= 6.13.0
uv >= 0.1.1
codespell

# https://github.com/python-trio/trio/pull/654#issuecomment-420518745
Expand Down
79 changes: 15 additions & 64 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,101 +1,73 @@
#
# 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 v0.1.1 via the following command:
# uv pip compile --python-version=3.8 test-requirements.in -o test-requirements.txt
alabaster==0.7.13
# via sphinx
astor==0.8.1
# via -r test-requirements.in
astroid==3.0.2
# via pylint
async-generator==1.10
# via -r test-requirements.in
attrs==23.2.0
# via
# -r test-requirements.in
# outcome
# via outcome
babel==2.14.0
# via sphinx
black==24.1.1 ; implementation_name == "cpython"
# via -r test-requirements.in
build==1.0.3
# via pip-tools
black==24.1.1
certifi==2024.2.2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, this change seems bugged

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made a bug report astral-sh/uv#1429

# via requests
cffi==1.16.0
# via cryptography
charset-normalizer==3.3.2
# via requests
click==8.1.7
# via
# black
# pip-tools
# via black
codespell==2.2.6
# via -r test-requirements.in
coverage==7.4.1
# via -r test-requirements.in
cryptography==42.0.2
# via
# -r test-requirements.in
# pyopenssl
# trustme
# types-pyopenssl
dill==0.3.8
# via pylint
docutils==0.20.1
# via sphinx
exceptiongroup==1.2.0 ; python_version < "3.11"
# via
# -r test-requirements.in
# pytest
exceptiongroup==1.2.0
# via pytest
idna==3.6
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change too seems wrong

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's intended, as we specify --python-version=3.8. If we generate separate test-requirements-pyXX.txt files for each python version we test we'll only get exceptiongroup in the ones that are <3.11

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I think that means we should have a requirements directory wherein we generate txt files for all versions we test.

# via
# -r test-requirements.in
# requests
# trustme
imagesize==1.4.1
# via sphinx
importlib-metadata==7.0.1
# via
# build
# sphinx
# via sphinx
iniconfig==2.0.0
# via pytest
isort==5.13.2
# via pylint
jedi==0.19.1
# via -r test-requirements.in
jinja2==3.1.3
# via sphinx
markupsafe==2.1.5
# via jinja2
mccabe==0.7.0
# via pylint
mypy==1.8.0 ; implementation_name == "cpython"
# via -r test-requirements.in
mypy-extensions==1.0.0 ; implementation_name == "cpython"
mypy==1.8.0
mypy-extensions==1.0.0
# via
# -r test-requirements.in
# black
# mypy
nodeenv==1.8.0
# via pyright
outcome==1.3.0.post0
# via -r test-requirements.in
packaging==23.2
# via
# black
# build
# pytest
# sphinx
parso==0.8.3
# via jedi
pathspec==0.12.1
# via black
pip-tools==7.3.0
# via -r test-requirements.in
platformdirs==4.2.0
CoolCat467 marked this conversation as resolved.
Show resolved Hide resolved
# via
# black
Expand All @@ -107,29 +79,21 @@ pycparser==2.21
pygments==2.17.2
# via sphinx
pylint==3.0.3
# via -r test-requirements.in
pyopenssl==24.0.0
# via -r test-requirements.in
pyproject-hooks==1.0.0
# via build
pyright==1.1.349
# via -r test-requirements.in
pytest==8.0.0
# via -r test-requirements.in
pytz==2024.1
# via babel
requests==2.31.0
# via sphinx
ruff==0.2.1
# via -r test-requirements.in
setuptools==69.1.0
# via nodeenv
A5rocks marked this conversation as resolved.
Show resolved Hide resolved
sniffio==1.3.0
# via -r test-requirements.in
snowballstemmer==2.2.0
# via sphinx
sortedcontainers==2.4.0
# via -r test-requirements.in
sphinx==7.1.2
# via -r test-requirements.in
sphinxcontrib-applehelp==1.0.4
# via sphinx
sphinxcontrib-devhelp==1.0.2
Expand All @@ -145,38 +109,25 @@ sphinxcontrib-serializinghtml==1.1.5
tomli==2.0.1
# via
# black
# build
# mypy
# pip-tools
# pylint
# pyproject-hooks
# pytest
tomlkit==0.12.3
# via pylint
trustme==1.1.0
# via -r test-requirements.in
types-cffi==1.16.0.20240106 ; implementation_name == "cpython"
# via -r test-requirements.in
types-cffi==1.16.0.20240106
types-docutils==0.20.0.20240201
# via -r test-requirements.in
types-pyopenssl==24.0.0.20240130 ; implementation_name == "cpython"
# via -r test-requirements.in
types-pyopenssl==24.0.0.20240130
types-setuptools==69.0.0.20240125
# via types-cffi
typing-extensions==4.9.0
# via
# -r test-requirements.in
# astroid
# black
# mypy
# pylint
urllib3==2.2.0
# via requests
wheel==0.42.0
# via pip-tools
uv==0.1.1
zipp==3.17.0
# via importlib-metadata

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