-
Notifications
You must be signed in to change notification settings - Fork 690
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Speed up
update-python3-dependencies
The `make update-python3-dependencies` step is slow for two main reasons: container image layering and pip-compile. Switch to the new uv tool, which reimplements pip-compile in a much faster way. The output is basically the same, except the sorting is smarter (e.g. pytest comes before pytest-cov) and package names are properly normalized. We can also drop the `--allow-unsafe` because uv is entirely independent of setuptools and pip-tools. Because uv is independent of the system Python (it's pure Rust), we can run it on the host and outside the container, so no image rebuilding happens during the updates, it'll just be needed once afterwards. uv is still quite new to the Python ecosystem, but this allows us to begin using it without any lock-in, it should be trivial to swap back to pip-tools if needed. Overall `make update-python3-dependencies` now takes seconds to run instead of minutes \o/ Refs <freedomofpress/securedrop-tooling#16>.
- Loading branch information
Showing
9 changed files
with
178 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
# shellcheck disable=SC2086 | ||
set -euxo pipefail | ||
|
||
COMMON_ARGS="--generate-hashes --python-version 3.8 --python-platform x86_64-unknown-linux-gnu --custom-compile-command ./securedrop/bin/update-requirements" | ||
|
||
cd "$(git rev-parse --show-toplevel)/securedrop" | ||
|
||
uv pip compile ${COMMON_ARGS} \ | ||
--output-file requirements/python3/develop-requirements.txt \ | ||
requirements/python3/translation-requirements.in \ | ||
requirements/python3/develop-requirements.in | ||
uv pip compile ${COMMON_ARGS} \ | ||
--output-file requirements/python3/test-requirements.txt \ | ||
requirements/python3/test-requirements.in | ||
uv pip compile ${COMMON_ARGS} \ | ||
--output-file requirements/python3/requirements.txt \ | ||
requirements/python3/requirements.in | ||
uv pip compile ${COMMON_ARGS} \ | ||
--output-file requirements/python3/bootstrap-requirements.txt \ | ||
requirements/python3/bootstrap-requirements.in | ||
uv pip compile ${COMMON_ARGS} \ | ||
--output-file requirements/python3/translation-requirements.txt \ | ||
requirements/python3/translation-requirements.in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.