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

Use uv instead of pip on production images #112496

Merged
merged 25 commits into from
Mar 22, 2024
Merged

Use uv instead of pip on production images #112496

merged 25 commits into from
Mar 22, 2024

Conversation

edenhaus
Copy link
Contributor

@edenhaus edenhaus commented Mar 6, 2024

Breaking change

Proposed change

Update uv from 0.1.17 to 0.1.22 to have prebuilt binaries for armhf and armv7:

The uv version used for production images will be extract from requirements_test.txt to use the same version as in the CI

Comparison of the build base image step:

Arch Pip 2023.3.1 Pip Nightly (18.03.24) UV (This PR)
aarch64 1h 38m 46s 1h 24m 53s 5m 18s
armhf 1h 30m 2s 1h 52m 20s 6m 2s
armv7 1h 27m 41s 1h 26m 43s 5m 28s
amd64 18m 49s 22m 10s 3m 20s
i386 23m 5s 17m 37s 3m 11s

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

@home-assistant home-assistant bot added cla-signed small-pr PRs with less than 30 lines. labels Mar 6, 2024
@edenhaus edenhaus added the ci-full-run Marks a PR to trigger a full CI run (instead of partial) label Mar 6, 2024
@bdraco
Copy link
Member

bdraco commented Mar 6, 2024

The failing test is a bit slow on gh actions. I fixed it in #112520

@charliermarsh
Copy link

Feel free to ping me directly if you run into problems or there's anything we can do to help.

@edenhaus edenhaus mentioned this pull request Mar 11, 2024
20 tasks
@edenhaus
Copy link
Contributor Author

@charliermarsh Currently UV is not providing binaries for the following architectures, which we build HA for:

Would it be possible to build binaries for these two arch directly in uv?

@edenhaus edenhaus removed the ci-full-run Marks a PR to trigger a full CI run (instead of partial) label Mar 11, 2024
Dockerfile Outdated Show resolved Hide resolved
@edenhaus edenhaus changed the title WIP: Use uv instead of pip WIP: Use uv instead of pip on production images Mar 15, 2024
Copy link

@home-assistant home-assistant bot left a comment

Choose a reason for hiding this comment

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

There is a merge conflict.

@bdraco
Copy link
Member

bdraco commented Mar 19, 2024

From https://github.com/home-assistant/core/actions/runs/8334291458/job/22807646088:

329.2 Caused by: Failed to download distribution due to network timeout. Try increasing UV_HTTP_TIMEOUT (current value: 300s).

Looks like when the CDN is having issues it needs a lower timeout, and some retries

pip retries on status_forcelist=[500, 502, 503, 520, 527]

@edenhaus edenhaus changed the title WIP: Use uv instead of pip on production images Use uv instead of pip on production images Mar 22, 2024
@edenhaus
Copy link
Contributor Author

@edenhaus edenhaus marked this pull request as ready for review March 22, 2024 14:34
@edenhaus edenhaus requested a review from frenck March 22, 2024 14:35
@edenhaus
Copy link
Contributor Author

edenhaus commented Mar 22, 2024

FAILED tests/components/axis/test_diagnostics.py::test_entry_diagnostics[api_discovery_items0] - AssertionError

unrelated

Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Amazing progress! 🎉

Let's see how this is going to behave on our nightly builds 👍

../Frenck

@frenck frenck merged commit c282172 into dev Mar 22, 2024
30 of 31 checks passed
@frenck frenck deleted the edenhaus-uv branch March 22, 2024 15:50
@github-actions github-actions bot locked and limited conversation to collaborators Mar 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla-signed small-pr PRs with less than 30 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants