From 01591767723611679e0dcc719ba8eb4f7f5657eb Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Fri, 12 Jun 2026 15:47:28 +0000 Subject: [PATCH] python upgraded due to enum --- backend/address2UPRN/handler/Dockerfile | 3 ++- backend/bulk_address2uprn_combiner/handler/Dockerfile | 5 +++++ backend/categorisation/handler/Dockerfile | 5 +++++ backend/ordnanceSurvey/handler/Dockerfile | 5 +++++ backend/postcode_splitter/handler/Dockerfile | 5 +++++ pytest.ini | 1 - .../tests => tests/infrastructure/epc_client}/__init__.py | 0 .../tests => tests/infrastructure/epc_client}/conftest.py | 0 .../tests => tests/infrastructure/epc_client}/test_client.py | 2 +- .../infrastructure/epc_client}/test_mapper_corpus.py | 0 .../infrastructure/epc_client}/test_mapper_dispatcher.py | 0 11 files changed, 23 insertions(+), 3 deletions(-) rename {infrastructure/epc_client/tests => tests/infrastructure/epc_client}/__init__.py (100%) rename {infrastructure/epc_client/tests => tests/infrastructure/epc_client}/conftest.py (100%) rename {infrastructure/epc_client/tests => tests/infrastructure/epc_client}/test_client.py (99%) rename {infrastructure/epc_client/tests => tests/infrastructure/epc_client}/test_mapper_corpus.py (100%) rename {infrastructure/epc_client/tests => tests/infrastructure/epc_client}/test_mapper_dispatcher.py (100%) diff --git a/backend/address2UPRN/handler/Dockerfile b/backend/address2UPRN/handler/Dockerfile index 017f260f..fddbcaab 100644 --- a/backend/address2UPRN/handler/Dockerfile +++ b/backend/address2UPRN/handler/Dockerfile @@ -1,4 +1,5 @@ -FROM public.ecr.aws/lambda/python:3.10 +# 3.11 required: domain.modelling.measure_type uses enum.StrEnum (added in 3.11). +FROM public.ecr.aws/lambda/python:3.11 # FROM python:3.11.10-bullseye diff --git a/backend/bulk_address2uprn_combiner/handler/Dockerfile b/backend/bulk_address2uprn_combiner/handler/Dockerfile index 35f91d09..610b71aa 100644 --- a/backend/bulk_address2uprn_combiner/handler/Dockerfile +++ b/backend/bulk_address2uprn_combiner/handler/Dockerfile @@ -17,6 +17,11 @@ RUN pip install --no-cache-dir -r requirements.txt COPY utils/ utils/ COPY backend/ backend/ COPY datatypes/ datatypes/ +# backend.app.db.models.recommendations imports infrastructure.postgres.modelling, +# which imports domain.modelling; without these the lambda fails at init with +# "No module named 'infrastructure'" / "'domain'". +COPY infrastructure/ infrastructure/ +COPY domain/ domain/ COPY backend/bulk_address2uprn_combiner/main.py . diff --git a/backend/categorisation/handler/Dockerfile b/backend/categorisation/handler/Dockerfile index 0a92eaba..16c3a0c0 100644 --- a/backend/categorisation/handler/Dockerfile +++ b/backend/categorisation/handler/Dockerfile @@ -32,6 +32,11 @@ COPY utils/ utils/ # NOTE: if build is ever slow we can be more specific with which files are copied COPY backend/ backend/ COPY datatypes/ datatypes/ +# backend.app.db.models.recommendations imports infrastructure.postgres.modelling, +# which imports domain.modelling; without these the lambda fails at init with +# "No module named 'infrastructure'" / "'domain'". +COPY infrastructure/ infrastructure/ +COPY domain/ domain/ # ----------------------------- diff --git a/backend/ordnanceSurvey/handler/Dockerfile b/backend/ordnanceSurvey/handler/Dockerfile index 6a3cbe26..ca266017 100644 --- a/backend/ordnanceSurvey/handler/Dockerfile +++ b/backend/ordnanceSurvey/handler/Dockerfile @@ -19,6 +19,11 @@ RUN pip install --no-cache-dir -r requirements.txt COPY utils/ utils/ COPY backend/ backend/ COPY datatypes/ datatypes/ +# backend.app.db.models.recommendations imports infrastructure.postgres.modelling, +# which imports domain.modelling; without these the lambda fails at init with +# "No module named 'infrastructure'" / "'domain'". +COPY infrastructure/ infrastructure/ +COPY domain/ domain/ # Lambda handler CMD ["backend/ordnanceSurvey/main.handler"] diff --git a/backend/postcode_splitter/handler/Dockerfile b/backend/postcode_splitter/handler/Dockerfile index 74c00b9f..1cc3e417 100644 --- a/backend/postcode_splitter/handler/Dockerfile +++ b/backend/postcode_splitter/handler/Dockerfile @@ -19,6 +19,11 @@ RUN pip install --no-cache-dir -r requirements.txt COPY utils/ utils/ COPY backend/ backend/ COPY datatypes/ datatypes/ +# backend.app.db.models.recommendations imports infrastructure.postgres.modelling, +# which imports domain.modelling; without these the lambda fails at init with +# "No module named 'infrastructure'" / "'domain'". +COPY infrastructure/ infrastructure/ +COPY domain/ domain/ # Copy the handler COPY backend/postcode_splitter/main.py . diff --git a/pytest.ini b/pytest.ini index 503c9ec8..2bcd6178 100644 --- a/pytest.ini +++ b/pytest.ini @@ -25,6 +25,5 @@ testpaths = etl/epc_clean/tests etl/hubspot/tests etl/spatial/tests - infrastructure/epc_client/tests/ markers = integration: mark a test as an integration test diff --git a/infrastructure/epc_client/tests/__init__.py b/tests/infrastructure/epc_client/__init__.py similarity index 100% rename from infrastructure/epc_client/tests/__init__.py rename to tests/infrastructure/epc_client/__init__.py diff --git a/infrastructure/epc_client/tests/conftest.py b/tests/infrastructure/epc_client/conftest.py similarity index 100% rename from infrastructure/epc_client/tests/conftest.py rename to tests/infrastructure/epc_client/conftest.py diff --git a/infrastructure/epc_client/tests/test_client.py b/tests/infrastructure/epc_client/test_client.py similarity index 99% rename from infrastructure/epc_client/tests/test_client.py rename to tests/infrastructure/epc_client/test_client.py index 2b6c4099..190513ce 100644 --- a/infrastructure/epc_client/tests/test_client.py +++ b/tests/infrastructure/epc_client/test_client.py @@ -5,7 +5,7 @@ from infrastructure.epc_client.epc_client_service import EpcClientService from datatypes.epc.search import EpcSearchResult from infrastructure.epc_client.exceptions import EpcNotFoundError, EpcRateLimitError from datatypes.epc.domain.epc_property_data import EpcPropertyData -from infrastructure.epc_client.tests.conftest import make_search_row +from tests.infrastructure.epc_client.conftest import make_search_row def _mock_response(status_code=200, json_data=None, headers=None): diff --git a/infrastructure/epc_client/tests/test_mapper_corpus.py b/tests/infrastructure/epc_client/test_mapper_corpus.py similarity index 100% rename from infrastructure/epc_client/tests/test_mapper_corpus.py rename to tests/infrastructure/epc_client/test_mapper_corpus.py diff --git a/infrastructure/epc_client/tests/test_mapper_dispatcher.py b/tests/infrastructure/epc_client/test_mapper_dispatcher.py similarity index 100% rename from infrastructure/epc_client/tests/test_mapper_dispatcher.py rename to tests/infrastructure/epc_client/test_mapper_dispatcher.py