Skip to content

Commit c405671

Browse files
authored
Merge pull request #4764 from alphagov/relax-some-pins
Relax some pins using compatible version operator and re-freeze
2 parents 853e0e1 + 4449b2a commit c405671

File tree

6 files changed

+34
-36
lines changed

6 files changed

+34
-36
lines changed

app/celery/process_ses_receipts_tasks.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import logging
22
from datetime import datetime, timedelta
33

4-
import iso8601
54
from celery.exceptions import Retry
65
from flask import current_app, json
76
from sqlalchemy.orm.exc import NoResultFound
@@ -42,7 +41,7 @@ def process_ses_results(self, response):
4241
try:
4342
notification = notifications_dao.dao_get_notification_or_history_by_reference(reference=reference)
4443
except NoResultFound:
45-
message_time = iso8601.parse_date(ses_message["mail"]["timestamp"]).replace(tzinfo=None)
44+
message_time = datetime.fromisoformat(ses_message["mail"]["timestamp"]).replace(tzinfo=None)
4645
if datetime.utcnow() - message_time < timedelta(minutes=5):
4746
extra = {"notification_reference": reference, "notification_status": notification_status}
4847
current_app.logger.info(

app/notifications/receive_notifications.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from datetime import datetime
22
from urllib.parse import unquote
33

4-
import iso8601
54
from flask import Blueprint, abort, current_app, jsonify, request
65
from gds_metrics.metrics import Counter
76

@@ -142,9 +141,9 @@ def format_mmg_datetime(date):
142141
"""
143142
try:
144143
orig_date = format_mmg_message(date)
145-
parsed_datetime = iso8601.parse_date(orig_date).replace(tzinfo=None)
144+
parsed_datetime = datetime.fromisoformat(orig_date).replace(tzinfo=None)
146145
return parsed_datetime
147-
except iso8601.ParseError:
146+
except ValueError:
148147
return datetime.utcnow()
149148

150149

app/schema_validation/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from datetime import datetime, timedelta
44
from uuid import UUID
55

6-
from iso8601 import ParseError, iso8601
76
from jsonschema import Draft7Validator, FormatChecker, ValidationError
87
from notifications_utils.recipient_validation.email_address import validate_email_address
98
from notifications_utils.recipient_validation.errors import InvalidEmailError, InvalidPhoneError
@@ -67,12 +66,12 @@ def validate_schema_postage_including_international(instance):
6766
def validate_schema_date_with_hour(instance):
6867
if isinstance(instance, str):
6968
try:
70-
dt = iso8601.parse_date(instance).replace(tzinfo=None)
69+
dt = datetime.fromisoformat(instance).replace(tzinfo=None)
7170
if dt < datetime.utcnow():
7271
raise ValidationError("datetime can not be in the past")
7372
if dt > datetime.utcnow() + timedelta(hours=24):
7473
raise ValidationError("datetime can only be 24 hours in the future")
75-
except ParseError as e:
74+
except ValueError as e:
7675
raise ValidationError(
7776
"datetime format is invalid. It must be a valid ISO8601 date time format, "
7877
"https://en.wikipedia.org/wiki/ISO_8601"

requirements.in

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,20 @@
44
celery[sqs]==5.6.0
55
# Pin kombu to merge of PR #2342 (SQS fair queue / MessageGroupId support) until kombu 5.7 is released
66
kombu @ git+https://github.com/celery/kombu.git@860e40a6c904c4d8551577d9f4e8c00f03b6e06c
7-
Flask-Bcrypt==1.0.1
7+
Flask-Bcrypt~=1.0
88
flask-marshmallow==1.3.0
99
Flask-Migrate==3.1.0
1010
flask-sqlalchemy==3.1.1
11-
click-datetime==0.2
11+
click-datetime~=0.2
1212
gunicorn[eventlet]~=25.1
1313
eventlet~=0.40.4
14-
iso8601==2.1.0
1514
jsonschema[format]==4.23.0
1615
marshmallow-sqlalchemy==1.0.0
1716
marshmallow==3.21.3
1817
psycopg2-binary==2.9.10
1918
PyJWT==2.10.1
2019
SQLAlchemy==2.0.41
21-
pyorc==0.10.0
20+
pyorc~=0.10
2221

2322
# temporary for debug output
2423
psutil>=6.0.0,<7.0.0
@@ -30,4 +29,4 @@ notifications-utils @ git+https://github.com/alphagov/notifications-utils.git@11
3029

3130
git+https://github.com/alphagov/gds_metrics_python.git@6f1840a57b6fb1ee40b7e84f2f18ec229de8aa72
3231

33-
sentry-sdk[flask,celery,sqlalchemy]==1.45.1
32+
sentry-sdk[flask,celery,sqlalchemy]~=1.45

requirements.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ blinker==1.9.0
2121
# flask
2222
# gds-metrics
2323
# sentry-sdk
24-
boto3==1.42.56
24+
boto3==1.42.60
2525
# via
2626
# celery
2727
# kombu
2828
# notifications-utils
29-
botocore==1.42.56
29+
botocore==1.42.60
3030
# via
3131
# boto3
3232
# s3transfer
33-
cachetools==7.0.1
33+
cachetools==7.0.2
3434
# via notifications-utils
3535
celery==5.6.0
3636
# via
@@ -50,7 +50,7 @@ click==8.3.1
5050
# click-plugins
5151
# click-repl
5252
# flask
53-
click-datetime==0.2
53+
click-datetime==0.4.0
5454
# via -r requirements.in
5555
click-didyoumean==0.3.1
5656
# via celery
@@ -94,7 +94,7 @@ fqdn==1.5.1
9494
# via jsonschema
9595
gds-metrics @ git+https://github.com/alphagov/gds_metrics_python.git@6f1840a57b6fb1ee40b7e84f2f18ec229de8aa72
9696
# via -r requirements.in
97-
govuk-bank-holidays==0.18
97+
govuk-bank-holidays==0.19
9898
# via notifications-utils
9999
greenlet==3.3.2
100100
# via eventlet
@@ -106,8 +106,6 @@ idna==3.11
106106
# via
107107
# jsonschema
108108
# requests
109-
iso8601==2.1.0
110-
# via -r requirements.in
111109
isoduration==20.11.0
112110
# via jsonschema
113111
itsdangerous==2.2.0
@@ -161,7 +159,7 @@ packaging==26.0
161159
# gunicorn
162160
# kombu
163161
# marshmallow
164-
phonenumbers==9.0.24
162+
phonenumbers==9.0.25
165163
# via notifications-utils
166164
prometheus-client==0.24.1
167165
# via gds-metrics
@@ -181,7 +179,7 @@ pyjwt==2.10.1
181179
# notifications-python-client
182180
pyorc==0.10.0
183181
# via -r requirements.in
184-
pypdf==6.7.3
182+
pypdf==6.7.5
185183
# via notifications-utils
186184
python-dateutil==2.9.0.post0
187185
# via
@@ -193,7 +191,7 @@ python-json-logger==4.0.0
193191
# via notifications-utils
194192
pyyaml==6.0.3
195193
# via notifications-utils
196-
redis==7.2.0
194+
redis==7.2.1
197195
# via flask-redis
198196
referencing==0.37.0
199197
# via
@@ -263,3 +261,5 @@ webcolors==25.10.0
263261
# via jsonschema
264262
werkzeug==3.1.6
265263
# via flask
264+
wheel==0.44.0
265+
# via click-datetime

requirements_for_test.txt

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,18 @@ blinker==1.9.0
3636
# -r requirements.txt
3737
# flask
3838
# gds-metrics
39-
boto3==1.42.56
39+
boto3==1.42.60
4040
# via
4141
# -r requirements.txt
4242
# moto
4343
# notifications-utils
44-
botocore==1.42.56
44+
botocore==1.42.60
4545
# via
4646
# -r requirements.txt
4747
# boto3
4848
# moto
4949
# s3transfer
50-
cachetools==7.0.1
50+
cachetools==7.0.2
5151
# via
5252
# -r requirements.txt
5353
# notifications-utils
@@ -73,7 +73,7 @@ click==8.3.1
7373
# click-plugins
7474
# click-repl
7575
# flask
76-
click-datetime==0.2
76+
click-datetime==0.4.0
7777
# via -r requirements.txt
7878
click-didyoumean==0.3.1
7979
# via
@@ -143,7 +143,7 @@ freezegun==1.5.5
143143
# via -r requirements_for_test_common.in
144144
gds-metrics @ git+https://github.com/alphagov/gds_metrics_python.git@6f1840a57b6fb1ee40b7e84f2f18ec229de8aa72
145145
# via -r requirements.txt
146-
govuk-bank-holidays==0.18
146+
govuk-bank-holidays==0.19
147147
# via
148148
# -r requirements.txt
149149
# notifications-utils
@@ -162,8 +162,6 @@ idna==3.11
162162
# trustme
163163
iniconfig==2.3.0
164164
# via pytest
165-
iso8601==2.1.0
166-
# via -r requirements.txt
167165
isoduration==20.11.0
168166
# via -r requirements.txt
169167
itsdangerous==2.2.0
@@ -241,7 +239,7 @@ packaging==26.0
241239
# pytest
242240
pathspec==1.0.4
243241
# via mypy
244-
phonenumbers==9.0.24
242+
phonenumbers==9.0.25
245243
# via
246244
# -r requirements.txt
247245
# notifications-utils
@@ -271,7 +269,7 @@ pyjwt==2.10.1
271269
# notifications-python-client
272270
pyorc==0.10.0
273271
# via -r requirements.txt
274-
pypdf==6.7.3
272+
pypdf==6.7.5
275273
# via
276274
# -r requirements.txt
277275
# notifications-utils
@@ -301,7 +299,7 @@ python-dateutil==2.9.0.post0
301299
# freezegun
302300
# moto
303301
# notifications-utils
304-
python-dotenv==1.2.1
302+
python-dotenv==1.2.2
305303
# via pytest-env
306304
python-json-logger==4.0.0
307305
# via
@@ -312,7 +310,7 @@ pyyaml==6.0.3
312310
# -r requirements.txt
313311
# notifications-utils
314312
# responses
315-
redis==7.2.0
313+
redis==7.2.1
316314
# via
317315
# -r requirements.txt
318316
# flask-redis
@@ -372,7 +370,7 @@ sqlalchemy==2.0.41
372370
# alembic
373371
# flask-sqlalchemy
374372
# marshmallow-sqlalchemy
375-
squawk-cli==2.42.0
373+
squawk-cli==2.43.0
376374
# via -r requirements_for_test.in
377375
statsd==4.0.1
378376
# via
@@ -384,7 +382,7 @@ types-cachetools==6.2.0.20251022
384382
# via -r requirements_for_test.in
385383
types-pycurl==7.45.7.20251101
386384
# via -r requirements_for_test.in
387-
types-python-dateutil==2.9.0.20260124
385+
types-python-dateutil==2.9.0.20260302
388386
# via -r requirements_for_test.in
389387
types-requests==2.32.4.20260107
390388
# via -r requirements_for_test.in
@@ -432,5 +430,9 @@ werkzeug==3.1.6
432430
# flask
433431
# moto
434432
# pytest-httpserver
433+
wheel==0.44.0
434+
# via
435+
# -r requirements.txt
436+
# click-datetime
435437
xmltodict==1.0.4
436438
# via moto

0 commit comments

Comments
 (0)