-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
CI: replace quansight-labs/setup-python with astral-sh/setup-uv #28181
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ngoldbaum. The changes look largely fine, and the one test skip doesn't bother me. However, the wrong python
version is being picked up in the Linux and macOS jobs (Windows is fine).
Thanks for the ping! I can give this a closer look soon. cc @eifinger who maintains |
Things should be fixed now. I wasn't correctly following the After fixing that it seems to fix the issues with using an incorrect Python install. There was one other test failure I ran into on Python 3.11 that is unrelated to this PR but I saw in CI because uv installs the latest version of python 3.11 and setuptools. You can verify yourself that doing Python 3.11.11 (main, Jan 21 2025, 14:04:14) [Clang 16.0.0 (clang-1600.0.26.6)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from distutils import msvccompiler
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'msvccompiler' from 'distutils' (/Users/goldbaum/.pyenv/versions/3.11.11/lib/python3.11/site-packages/setuptools/_distutils/__init__.py)
>>> import setuptools
>>> setuptools.__version__
'75.8.0' The fix is to use an older version of setuptools on Python < 3.12, which we were already doing in |
The |
The CI job is a bit weird about showing why it fails, you have to click on "Vulnerabilities" (at least this time). The reason is:
On first read, I doubt we need to (or can) worry about it and should just ignore it. I suppose we must have ignored it before, but moving the dependency shows it again. |
Agreed, we can ignore it. Should be doable with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once the dependency review action failure is resolved.
Merging since the failure is unrelated (#28227) |
This PR replaces all uses of
quansight-labs/setup-python
(a fork my team at Quansight is reluctantly maintaining) withsetup-uv
.setup-uv
is an attempt to useuv
to create a more-or-less drop-in replacement forsetup-python
.This is a re-do of #27581, which tried to integrate setup-uv into the NumPy CI and ran into issues. Since then uv and setup-uv have seen a number of improvements, and as far as I can tell all the issues I ran into back in October have been fixed.
On Windows, the python scripts aren't in the PATH, so I updated everything to use the
python -m
convention. There was also one mingw-specific test that got triggered on Python 3.11 on CI due to the presence ofnm.exe
in thePATH
. Since the test failed trying to write to a directory that doesn't exist (and presumably does on MinGW) - I made it so the test is skipped if the directory needed by the test doesn't exist. See this CI run on my fork for more detail.ping @zanieb