python-trio / trio

Trio – a friendly Python library for async concurrency and I/O
https://trio.readthedocs.io
Other
5.98k stars 325 forks source link

Switch to `uv pip compile` #2958

Open CoolCat467 opened 4 months ago

CoolCat467 commented 4 months ago

This pull request follows up on #2956 and is attempting to switch the continuous integration system to use astral.sh' new tool uv. This particular pull request is a subset of #2957 and is in charge of only replacing pip-compile.

This seems nontrivial, can we break this into 2 prs?

1. replace pip-compile

2. replace pip install

Personally I see (1) as much more valuable-- (2) doesn't change much. Personally I'm more excited by uv's ability to get the lowest compatible version so we can add a new CI run than by it replacing pip install.

Originally posted by @A5rocks in https://github.com/python-trio/trio/issues/2957#issuecomment-1947713570

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.63%. Comparing base (80eec96) to head (d51aae3).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2958 +/- ## ======================================= Coverage 99.63% 99.63% ======================================= Files 120 120 Lines 17865 17865 Branches 3216 3216 ======================================= Hits 17800 17800 Misses 46 46 Partials 19 19 ```
A5rocks commented 1 week ago

uv seems to support keeping keeping things like implementation_name now: https://github.com/astral-sh/uv/pull/4503

I think once this uses that flag, this is good for me

CoolCat467 commented 1 week ago

So, added --no-strip-markers, but since there hasn't been a proper release with these changes yet, using a git commit dependency for uv at the moment, which works, but CI fails because full cargo isn't installed on the windows or alpine runners.

I think we just need to wait for a proper release with these changes to come out, but otherwise this pull request should be almost done!

charliermarsh commented 1 week ago

I think we just need to wait for a proper release with these changes to come out, but otherwise this pull request should be almost done!

Heads up we plan to cut a release today.

CoolCat467 commented 1 week ago

Ok so it looks like everything is working except for an issue that happens when importing cryptography on the 3.13 runner, with this error: E ImportError: /opt/hostedtoolcache/Python/3.13.0-beta.2/x64/lib/python3.13/site-packages/_cffi_backend.cpython-313-x86_64-linux-gnu.so: undefined symbol: _PyErr_WriteUnraisableMsg

I don't think this is caused by uv, probably an issue with cryptography. Version that 3.13 runner used to have this result: cryptography-42.0.8

A5rocks commented 1 week ago

I'm surprised pulling in master didn't work. I manually edited the test requirements to use a pre-release of cffi (IIRC? Or maybe cryptography) to fix that.