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

Update dependencies to resolve security alerts #1146

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
7 changes: 4 additions & 3 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ steps:
queue: "scala"

- command:
pip3 install --user tox &&
cd scripts &&
/var/lib/buildkite-agent/.local/bin/tox -e py3
- cd scripts
- python3 -m venv venv && source venv/bin/activate
Copy link
Contributor Author

@StepanBrychta StepanBrychta Oct 3, 2024

Choose a reason for hiding this comment

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

Run tests in a virtual environment to prevent this confusing error message about incompatible package versions:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
requests 2.25.1 requires chardet<5,>=3.0.2, but you have chardet 5.2.0 which is incompatible.

- pip3 install tox
- venv/bin/tox -e py3
label: "Test Python scripts"

- wait
Expand Down
71 changes: 48 additions & 23 deletions monitoring/daily_reporter/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,52 @@
#
# This file is autogenerated by pip-compile
# To update, run:
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile
#
boto3==1.13.12 # via -r requirements.in
botocore==1.16.12 # via boto3, s3transfer
certifi==2020.4.5.1 # via httpx
chardet==3.0.4 # via httpx
docutils==0.15.2 # via botocore
h11==0.9.0 # via httpx
h2==3.2.0 # via httpx
hpack==3.0.0 # via h2
hstspreload==2020.5.19 # via httpx
httpx==0.12.1 # via -r requirements.in
hyperframe==5.2.0 # via h2
idna==2.9 # via httpx
jinja2==2.11.2 # via -r requirements.in
jmespath==0.10.0 # via boto3, botocore
markupsafe==1.1.1 # via jinja2
python-dateutil==2.8.1 # via botocore
rfc3986==1.4.0 # via httpx
s3transfer==0.3.3 # via boto3
six==1.14.0 # via python-dateutil
sniffio==1.1.0 # via httpx
urllib3==1.25.9 # via botocore, httpx
anyio==4.6.0
# via httpx
boto3==1.35.32
# via -r requirements.in
botocore==1.35.32
# via
# boto3
# s3transfer
certifi==2024.8.30
# via
# httpcore
# httpx
exceptiongroup==1.2.2
# via anyio
h11==0.14.0
# via httpcore
httpcore==1.0.6
# via httpx
httpx==0.27.2
# via -r requirements.in
idna==3.10
# via
# anyio
# httpx
jinja2==3.1.4
# via -r requirements.in
jmespath==1.0.1
# via
# boto3
# botocore
markupsafe==2.1.5
# via jinja2
python-dateutil==2.9.0.post0
# via botocore
s3transfer==0.10.2
# via boto3
six==1.16.0
# via python-dateutil
sniffio==1.3.1
# via
# anyio
# httpx
typing-extensions==4.12.2
# via anyio
urllib3==2.2.3
# via botocore
56 changes: 39 additions & 17 deletions monitoring/end_to_end_bag_test/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,44 @@
#
# This file is autogenerated by pip-compile
# To update, run:
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile
#
certifi==2020.4.5.1 # via httpx, requests
chardet==3.0.4 # via httpx, requests
h11==0.9.0 # via httpx
h2==3.2.0 # via httpx
hpack==3.0.0 # via h2
hstspreload==2020.5.13 # via httpx
httpx==0.12.1
hyperframe==5.2.0 # via h2
idna==2.9 # via httpx, requests
oauthlib==3.1.0 # via requests-oauthlib
requests-oauthlib==1.3.0 # via wellcome-storage-service
requests==2.23.0 # via requests-oauthlib
rfc3986==1.4.0 # via httpx
sniffio==1.1.0 # via httpx
urllib3==1.25.9 # via httpx, requests
anyio==4.6.0
# via httpx
certifi==2024.8.30
# via
# httpcore
# httpx
# requests
charset-normalizer==3.3.2
# via requests
exceptiongroup==1.2.2
# via anyio
h11==0.14.0
# via httpcore
httpcore==1.0.6
# via httpx
httpx==0.27.2
# via -r requirements.in
idna==3.10
# via
# anyio
# httpx
# requests
oauthlib==3.2.2
# via requests-oauthlib
requests==2.32.3
# via requests-oauthlib
requests-oauthlib==1.3.1
# via wellcome-storage-service
sniffio==1.3.1
# via
# anyio
# httpx
typing-extensions==4.12.2
# via anyio
urllib3==2.2.3
# via requests
wellcome-storage-service==1.5.0
# via -r requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def main(*args):
print(ingest_location)

ingest_id = ingest_location.split("/")[-1]
return f"https://ingest-inspector.wellcomecollection.org/ingests/{ingest_id}"
return f"https://ingest-inspector.wellcomecollection.org/?ingestId={ingest_id}"


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion scripts/test_requirements.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
moto<4
moto
pytest
pytest-cov
coverage
68 changes: 32 additions & 36 deletions scripts/test_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,88 +1,84 @@
#
# This file is autogenerated by pip-compile
# To update, run:
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
#
# pip-compile test_requirements.in
#
attrs==22.1.0
# via pytest
boto3==1.24.59
boto3==1.35.32
# via moto
botocore==1.27.59
botocore==1.35.32
# via
# boto3
# moto
# s3transfer
certifi==2022.6.15
certifi==2024.8.30
# via requests
cffi==1.15.1
cffi==1.17.1
# via cryptography
charset-normalizer==2.1.1
charset-normalizer==3.3.2
# via requests
coverage[toml]==6.4.4
coverage[toml]==7.6.1
# via
# -r test_requirements.in
# pytest-cov
cryptography==37.0.4
cryptography==43.0.1
# via moto
idna==3.3
exceptiongroup==1.2.2
# via pytest
idna==3.10
# via requests
iniconfig==1.1.1
iniconfig==2.0.0
# via pytest
jinja2==3.1.2
jinja2==3.1.4
# via moto
jmespath==1.0.1
# via
# boto3
# botocore
markupsafe==2.1.1
markupsafe==2.1.5
# via
# jinja2
# moto
moto==3.1.18
# werkzeug
moto==5.0.16
# via -r test_requirements.in
packaging==21.3
# via pytest
pluggy==1.0.0
packaging==24.1
# via pytest
py==1.11.0
pluggy==1.5.0
# via pytest
pycparser==2.21
pycparser==2.22
# via cffi
pyparsing==3.0.9
# via packaging
pytest-cov==3.0.0
# via -r test_requirements.in
pytest==7.1.2
pytest==8.3.3
# via
# -r test_requirements.in
# pytest-cov
python-dateutil==2.8.2
pytest-cov==5.0.0
# via -r test_requirements.in
python-dateutil==2.9.0.post0
# via
# botocore
# moto
pytz==2022.2.1
# via moto
requests==2.28.1
pyyaml==6.0.2
# via responses
requests==2.32.3
# via
# moto
# responses
responses==0.21.0
responses==0.25.3
# via moto
s3transfer==0.6.0
s3transfer==0.10.2
# via boto3
six==1.16.0
# via python-dateutil
tomli==2.0.1
tomli==2.0.2
# via
# coverage
# pytest
urllib3==1.26.12
urllib3==1.26.20
# via
# botocore
# requests
# responses
werkzeug==2.1.2
werkzeug==3.0.4
# via moto
xmltodict==0.13.0
# via moto
2 changes: 1 addition & 1 deletion scripts/tests/test_dynamo.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

@pytest.fixture
def client():
with moto.mock_dynamodb2():
with moto.mock_aws():
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The new version of moto has a slightly different interface, so we need to use mock_aws.

yield boto3.resource("dynamodb", region_name="eu-west-1").meta.client


Expand Down
2 changes: 1 addition & 1 deletion scripts/tests/test_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

@pytest.fixture
def client():
with moto.mock_s3():
with moto.mock_aws():
yield boto3.client("s3", region_name="us-east-1")


Expand Down
2 changes: 1 addition & 1 deletion scripts/tests/test_secrets.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

@pytest.fixture
def client():
with moto.mock_secretsmanager():
with moto.mock_aws():
yield boto3.client("secretsmanager", region_name="eu-west-1")


Expand Down
2 changes: 1 addition & 1 deletion scripts/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ skipsdist = True
deps =
-r{toxinidir}/test_requirements.txt
commands =
coverage run -m py.test tests
coverage run -m pytest tests
coverage report