Closed matthewfeickert closed 2 months ago
Need https://github.com/astral-sh/uv/issues/1526 or an alternative for this to work first.
Edit: Can do this for the time being:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set the VIRTUAL_ENV variable for uv to work
run: |
echo "VIRTUAL_ENV=${Python_ROOT_DIR}" >> $GITHUB_ENV
- name: Install dependencies
run: |
python -m pip install uv
python -m uv pip install --upgrade <stuff>
which comes from https://github.com/astral-sh/uv/issues/1386#issuecomment-1947801083.
Also needs https://github.com/astral-sh/uv/pull/1531 so will have to wait for the next release of uv
(if that PR goes in).
Given https://github.com/astral-sh/uv/pull/1531#issuecomment-1950752750 we also need https://github.com/astral-sh/uv/issues/313 to go in.
Okay with https://github.com/astral-sh/uv/issues/1526 in and using the
install "pyhf[extras] @ ."
pattern over
install ".[extras]"
pattern I think this should be good.
edit: No, uv pip
is resolving dependencies for tensorflow
different than pip
does and this breaks.
Reported failure in https://github.com/astral-sh/uv/issues/2062
Also blocked by https://github.com/astral-sh/uv/issues/2685
So this is really blocked by papermill
given https://github.com/nteract/papermill/pull/789 is in and so just waiting for a papermill
v2.5.1
or v2.6.0
release.
With the release of papermill
v2.6.0
(https://github.com/nteract/papermill/issues/785#issuecomment-2080971385) and relaxing to
...
"papermill>=2.5.0",
"scrapbook>=0.5.0",
...
https://github.com/astral-sh/uv/issues/2685 is sidestepped, but the issue with TensorFlow dependency resolution in https://github.com/astral-sh/uv/issues/2062 is still blocking.
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 98.21%. Comparing base (
682ce76
) to head (854906d
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Okay, I think this is finally working as expected across all workflows now.
Some examples of install time drops:
OS | Python | pip |
uv pip |
---|---|---|---|
Ubuntu | 3.12 | 2m 57 s | 38 s |
macOS (Intel) | 3.12 | 2m 51 s | 50 s |
macOS (Apple silicon) | 3.12 | 1m 6 s | 16 s |
:rocket:
I'm going to approve and merge this myself. As always, PRs approved by a single core dev can be reverted as needed by the rest of the dev team.
Description
Use
uv
to try to speed up the installs of all the Python dependencies.Fall back to using
pip
for Python 3.8 until https://github.com/astral-sh/uv/issues/2062 is resolved.Apply subtle changes to install commands in .github/workflows/dependencies-head.yml.
uv pip install --upgrade
will try to upgrade all dependencies of the target package as well, which for the dependencies-head workflow isn't the goal. So remove the--upgrade
from calls that also install from the scientific-python-nightly-wheels package index when testing only particular packages.up pip
andpip
have different behavior with regards to--extra-index-url
, asuv pip
gives--extra-index-url
priority over--index-url
, wherepip
does not give priority to either. Use this withuv pip
to give priority to the scientific-python-nightly-wheels package index.Checklist Before Requesting Reviewer
Before Merging
For the PR Assignees: