-
Notifications
You must be signed in to change notification settings - Fork 685
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. Currently, each `pip-compile` step is run in a separate dev-shell, which means after each one, if anything changed in the requirements/ folder, it needs to rebuild the slim image and reinstall all the pip dependencies. Now I've moved the steps to a separate script that execute in a single dev-shell, so no image rebuilding happens during the updates, it'll just be needed once afterwards. For an additional boost, 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. 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
8 changed files
with
172 additions
and
174 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
set -euxo pipefail | ||
|
||
uv pip compile --generate-hashes \ | ||
--output-file requirements/python3/develop-requirements.txt \ | ||
requirements/python3/translation-requirements.in \ | ||
requirements/python3/develop-requirements.in | ||
uv pip compile --generate-hashes \ | ||
--output-file requirements/python3/test-requirements.txt \ | ||
requirements/python3/test-requirements.in | ||
uv pip compile --generate-hashes \ | ||
--output-file requirements/python3/requirements.txt \ | ||
requirements/python3/requirements.in | ||
uv pip compile --generate-hashes \ | ||
--output-file requirements/python3/bootstrap-requirements.txt \ | ||
requirements/python3/bootstrap-requirements.in | ||
uv pip compile --generate-hashes \ | ||
--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
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.