Skip to content

Commit a34a326

Browse files
TomdangoJackPlowmanmabe13Corbiscmik3ola
authored
Release 26.0 (#1031)
# Release Branch Pull Request ## Description of Changes This PR release DI version 26 Updates the project lambdas to Python 3.12 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Jack Plowman <62281988+JackPlowman@users.noreply.github.com> Co-authored-by: Matthew Begley <60427904+mabe13@users.noreply.github.com> Co-authored-by: Corbisc <95412908+Corbisc@users.noreply.github.com> Co-authored-by: mabe13 <matthewbegley@nhs.net> Co-authored-by: Michael Olaw <michael.olaw1@nhs.net> Co-authored-by: Jack Plowman <jack.plowman1@nhs.net> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Vamsi Jonnagadda <vamsijonnagadda@ICTs-MacBook-Pro.local> Co-authored-by: vkjonnagadda <32249251+vkjonnagadda@users.noreply.github.com>
1 parent b347953 commit a34a326

28 files changed

Lines changed: 70 additions & 74 deletions

File tree

.github/workflows/code-quality.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
-Dsonar.projectKey=uec-dos-int
3939
-Dsonar.coverage.exclusions=tests/**,**/tests/**,infrastructure,application/dos_db_handler/**,test/**,scripts/**,application/conftest.py
4040
-Dsonar.python.coverage.reportPaths=coverage.xml
41-
-Dsonar.python.version=3.11
41+
-Dsonar.python.version=3.12
4242
-Dsonar.exclusions=application/**/tests/**
4343
4444
check-markdown-code-quality:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ The main components you will need for _basic_ development work, are your OS vers
100100

101101
- A VPN Client (OpenVPN or Tunnelblick are 2 NHS Digital suggested options)
102102
- Git
103-
- Python (The project currently runs on 3.11)
103+
- Python (The project currently runs on 3.12)
104104
- AWS CLI
105105
- Docker
106106

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
aws-lambda-powertools[tracer] ~= 2.26.1
1+
aws-lambda-powertools[tracer] ~= 2.43.0

application/common/dos.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
class DoSService:
2828
"""Class to represent a DoS Service."""
2929

30-
id: int # noqa: A003
30+
id: int
3131
uid: int
3232
name: str
3333
odscode: str
@@ -251,10 +251,10 @@ def db_rows_to_spec_open_times(db_rows: Iterable[dict]) -> list[SpecifiedOpening
251251
"""
252252
specified_opening_times = []
253253
date_sorted_rows = sorted(db_rows, key=lambda row: (row["date"], row["starttime"]))
254-
for date, db_rows in groupby(date_sorted_rows, lambda row: row["date"]):
254+
for date, rows in groupby(date_sorted_rows, lambda row: row["date"]):
255255
is_open = True
256256
open_periods = []
257-
for row in list(db_rows):
257+
for row in list(rows):
258258
if row["isclosed"] is True:
259259
is_open = False
260260
else:

application/common/dos_location.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
class DoSLocation:
77
"""A Class to represent a location in the UK store within the DoS Database locations table."""
88

9-
id: int # noqa: A003
9+
id: int
1010
postcode: str
1111
easting: float
1212
northing: float

application/common/dynamodb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def add_change_event_to_dynamodb(change_event: dict[str, Any], sequence_number:
4949
put_item = {k: serializer.serialize(v) for k, v in dynamo_record.items()}
5050
response = dynamodb.put_item(TableName=environ["CHANGE_EVENTS_TABLE_NAME"], Item=put_item)
5151
logger.info("Added record to dynamodb", response=response, item=put_item)
52-
except Exception as err: # noqa: BLE001
52+
except Exception as err:
5353
msg = f"Unable to add change event (seq no: {sequence_number}) into dynamodb"
5454
raise DynamoDBError(msg) from err
5555
return record_id

application/common/tests/test_opening_times.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -462,11 +462,11 @@ def test_specifiedopentime_export_service_history_format_open() -> None:
462462
# Act
463463
result = specified_opening_time.export_service_history_format()
464464
# Assert
465-
assert [
465+
assert result == [
466466
"2021-12-24-28800-43200",
467467
"2021-12-24-46800-63000",
468468
"2021-12-24-68400-84600",
469-
] == result
469+
]
470470

471471

472472
def test_specifiedopentime_export_service_history_format_closed() -> None:
@@ -475,7 +475,7 @@ def test_specifiedopentime_export_service_history_format_closed() -> None:
475475
# Act
476476
result = specified_opening_time.export_service_history_format()
477477
# Assert
478-
assert ["2021-12-24-closed"] == result
478+
assert result == ["2021-12-24-closed"]
479479

480480

481481
def test_specifiedopentime_export_dos_log_format_open() -> None:
@@ -488,7 +488,7 @@ def test_specifiedopentime_export_dos_log_format_open() -> None:
488488
# Act
489489
result = specified_opening_time.export_dos_log_format()
490490
# Assert
491-
assert ["2021-12-24-09:00-11:00"] == result
491+
assert result == ["2021-12-24-09:00-11:00"]
492492

493493

494494
def test_specifiedopentime_export_dos_log_format_closed() -> None:
@@ -497,7 +497,7 @@ def test_specifiedopentime_export_dos_log_format_closed() -> None:
497497
# Act
498498
result = specified_opening_time.export_dos_log_format()
499499
# Assert
500-
assert ["2021-12-24-closed"] == result
500+
assert result == ["2021-12-24-closed"]
501501

502502

503503
@pytest.mark.parametrize(
@@ -636,7 +636,7 @@ def test_stdopeningtimes_export_opening_times_for_day() -> None:
636636
# Act
637637
response = st1.export_opening_times_for_day("monday")
638638
# Assert
639-
assert ["08:00-12:00", "13:00-18:00"] == response
639+
assert response == ["08:00-12:00", "13:00-18:00"]
640640

641641

642642
def test_stdopeningtimes_export_opening_times_in_seconds_for_day() -> None:
@@ -649,7 +649,7 @@ def test_stdopeningtimes_export_opening_times_in_seconds_for_day() -> None:
649649
# Act
650650
response = st1.export_opening_times_in_seconds_for_day("monday")
651651
# Assert
652-
assert ["32400-46800", "50400-68400"] == response
652+
assert response == ["32400-46800", "50400-68400"]
653653

654654

655655
def test_standard_opening_times_export_test_format() -> None:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
aws-lambda-powertools[tracer] ~= 2.26.1
1+
aws-lambda-powertools[tracer] ~= 2.43.0
22
psycopg[binary]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
aws-lambda-powertools[tracer] ~= 2.26.1
1+
aws-lambda-powertools[tracer] ~= 2.43.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
aws-lambda-powertools[tracer] ~= 2.26.1
1+
aws-lambda-powertools[tracer] ~= 2.43.0
22
simplejson

0 commit comments

Comments
 (0)