Integrate 'uv' for enhanced package management#21002
Integrate 'uv' for enhanced package management#21002jmchilton merged 20 commits intogalaxyproject:devfrom
Conversation
mvdbeek
left a comment
There was a problem hiding this comment.
Overall I love it, but I think we shouldn't just bootstrap it. If it's installed, we should use it, do you think you could implement that ?
|
@nsoranzo In update.sh we are already forcing UV installation. Should we move the installation of UV to one level higher in the CI job and instead use the system UV if it exists in the bash code? if command -v uv >/dev/null; then
uv="$(command -v uv)"
else
uv_venv=$(mktemp -d "${TMPDIR:-/tmp}/uv_venv.XXXXXXXXXX")
python3 -m venv "${uv_venv}"
"${uv_venv}/bin/python" -m pip install uv
uv="${uv_venv}/bin/uv"
fi |
|
To use this in GitHub Actions, we need to add astral-sh/setup-uv as a step in our workflows. |
|
Do we have any plans to use |
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| cache: 'pip' | ||
| cache-dependency-path: 'galaxy root/requirements.txt' |
There was a problem hiding this comment.
Are we loosing this caching or is UV doing something similar under the hood?
There was a problem hiding this comment.
UV has its own caching system, which is enabled by default on GitHub-hosted runners.
I'm not sure whether we should use the cache-dependency-glob option to add our requirements, or if it picks them up automatically.
|
This will conflict with #21016 - but I am happy to update it after this is merged. Exciting stuff for sure. In this commit the uv supports made that test.sh file much uglier - but longer term after #21016 actually UV makes that whole pipeline much cleaner - it seems quite capable of allowing us to drop our ad-hoc DAG tracking and our custom incremental building of dependent packages. |
I guess a non-response from anyone is a no? We do |
I worry that reviewing the "Update Python dependencies" pull requests with only |
5af8e95 to
18d6672
Compare
|
The failed test seems to be unrelated, but it keeps happening! |
18d6672 to
85a8b39
Compare
85a8b39 to
4575c13
Compare
|
The "Test Galaxy packages" errors are different than usual, not sure if it's related to this PR. |
I think the problem is that when using uv, we need to install without resolving dependencies from the lock file or pulling them from PyPI, since we're installing in dependency order from local packages |
Using `uv tool install` instead of `uv pip install --system` Co-authored-by: Marius van den Beek <m.vandenbeek@gmail.com>
Co-authored-by: Nicola Soranzo <nicola.soranzo@gmail.com>
…ation Co-authored-by: Nicola Soranzo <nicola.soranzo@gmail.com>
…e for improved readability and maintainability
in case it's installed inside a virtual environment.
`uv pip` installs directories as editable packages by default. mypy does not recognize that libraries installed as editable using setuptools are fully typed even though the `py.typed` file is correctly included. This combination results in spurious mypy errors in package tests if packages are installed via `uv pip`. See also: astral-sh/uv#3898 pypa/setuptools#3518
2cfa6bc to
2430d3c
Compare
4c8236a to
23b47ee
Compare
23b47ee to
f20306b
Compare
|
This PR was merged without a "kind/" label, please correct. |
Implement uv to improve installation speed and streamline virtual environment creation across scripts. This change ensures faster package management and eliminates the need for manual pip upgrades.
How to test the changes?
(Select all options that apply)
License