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

Speed up update-python3-dependencies #7234

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 1 addition & 21 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,7 @@ update-admin-pip-requirements: ## Update admin requirements.
.PHONY: update-python3-requirements
update-python3-requirements: ## Update Python 3 requirements with pip-compile.
@echo "███ Updating Python 3 requirements files..."
@SLIM_BUILD=1 $(DEVSHELL) pip-compile --generate-hashes \
--allow-unsafe \
--output-file requirements/python3/develop-requirements.txt \
requirements/python3/translation-requirements.in \
requirements/python3/develop-requirements.in
@SLIM_BUILD=1 $(DEVSHELL) pip-compile --generate-hashes \
--allow-unsafe \
--output-file requirements/python3/test-requirements.txt \
requirements/python3/test-requirements.in
@SLIM_BUILD=1 $(DEVSHELL) pip-compile --generate-hashes \
--allow-unsafe \
--output-file requirements/python3/requirements.txt \
requirements/python3/requirements.in
@SLIM_BUILD=1 $(DEVSHELL) pip-compile --generate-hashes \
--allow-unsafe \
--output-file requirements/python3/bootstrap-requirements.txt \
requirements/python3/bootstrap-requirements.in
@SLIM_BUILD=1 $(DEVSHELL) pip-compile --generate-hashes \
--allow-unsafe \
--output-file requirements/python3/translation-requirements.txt \
requirements/python3/translation-requirements.in
@$(SDBIN)/update-requirements

.PHONY: update-pip-requirements
update-pip-requirements: update-admin-pip-requirements update-python3-requirements ## Update all requirements with pip-compile.
Expand Down
24 changes: 24 additions & 0 deletions securedrop/bin/update-requirements
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
30 changes: 12 additions & 18 deletions securedrop/requirements/python3/bootstrap-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --allow-unsafe --generate-hashes --output-file=requirements/python3/bootstrap-requirements.txt requirements/python3/bootstrap-requirements.in
#
# This file was autogenerated by uv via the following command:
# ./securedrop/bin/update-requirements
packaging==24.1 \
--hash=sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002 \
--hash=sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124
# via setuptools-scm
pip==21.3 \
--hash=sha256:4a1de8f97884ecfc10b48fe61c234f7e7dcf4490a37217011ad9369d899ad5a6 \
--hash=sha256:741a61baab1dbce2d8ca415effa48a2b6a964564f81a9f4f1fce4c433346c034
# via -r requirements/python3/bootstrap-requirements.in
setuptools==70.3.0 \
--hash=sha256:f171bab1dfbc86b132997f26a119f6056a57950d058587841a0082e8830f9dc5 \
--hash=sha256:fe384da74336c398e0d956d1cae0669bc02eed936cdb1d49b57de1990dc11ffc
# via
# -r requirements/python3/bootstrap-requirements.in
# setuptools-scm
setuptools-scm==8.1.0 \
--hash=sha256:42dea1b65771cba93b7a515d65a65d8246e560768a66b9106a592c8e7f26c8a7 \
--hash=sha256:897a3226a6fd4a6eb2f068745e49733261a21f70b1bb28fce0339feb978d9af3
Expand All @@ -24,15 +30,3 @@ wheel==0.38.4 \
--hash=sha256:965f5259b566725405b05e7cf774052044b1ed30119b5d586b2703aafe8719ac \
--hash=sha256:b60533f3f5d530e971d6737ca6d58681ee434818fab630c83a734bb10c083ce8
# via -r requirements/python3/bootstrap-requirements.in

# The following packages are considered to be unsafe in a requirements file:
pip==21.3 \
--hash=sha256:4a1de8f97884ecfc10b48fe61c234f7e7dcf4490a37217011ad9369d899ad5a6 \
--hash=sha256:741a61baab1dbce2d8ca415effa48a2b6a964564f81a9f4f1fce4c433346c034
# via -r requirements/python3/bootstrap-requirements.in
setuptools==70.3.0 \
--hash=sha256:f171bab1dfbc86b132997f26a119f6056a57950d058587841a0082e8830f9dc5 \
--hash=sha256:fe384da74336c398e0d956d1cae0669bc02eed936cdb1d49b57de1990dc11ffc
# via
# -r requirements/python3/bootstrap-requirements.in
# setuptools-scm
5 changes: 2 additions & 3 deletions securedrop/requirements/python3/develop-requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ molecule-vagrant==0.3
# Needed for ansible network filter
# http://docs.ansible.com/ansible/latest/playbooks_filters_ipaddr.html
netaddr
# Now also pin pip due to https://github.com/jazzband/pip-tools/issues/853
pip>=21.3
pip-tools>=6.1.0
pip
polib
prompt_toolkit==2.0.9
psutil>=5.6.6
Expand All @@ -43,4 +41,5 @@ six==1.15.0
testinfra>=5.3.1
translate-toolkit
urllib3>=1.26.5
uv
yamllint
Loading