Skip to content

Commit b313a23

Browse files
committed
Merge branch 'master' into VED-81-Number-Update
# Conflicts: # Makefile
2 parents dd9461f + b80081d commit b313a23

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+2832
-2179
lines changed

.github/workflows/sonarcloud.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,11 @@ jobs:
2222
fetch-depth: 0
2323

2424
- name: Install poetry
25-
run: pip install poetry==1.8.4
25+
run: pip install poetry==2.1.2
2626

2727
- uses: actions/setup-python@v5
2828
with:
29-
python-version: |
30-
3.10
31-
3.11
29+
python-version: 3.11
3230
cache: 'poetry'
3331

3432
- name: Set up AWS credentials
@@ -44,7 +42,6 @@ jobs:
4442
id: filenameprocessor
4543
continue-on-error: true
4644
run: |
47-
poetry env use 3.11
4845
poetry install
4946
poetry run coverage run -m unittest discover || echo "filenameprocessor tests failed" >> ../failed_tests.txt
5047
poetry run coverage xml -o ../filenameprocessor-coverage.xml
@@ -54,7 +51,6 @@ jobs:
5451
id: recordprocessor
5552
continue-on-error: true
5653
run: |
57-
poetry env use 3.11
5854
poetry install
5955
poetry run coverage run -m unittest discover || echo "recordprocessor tests failed" >> ../failed_tests.txt
6056
poetry run coverage xml -o ../recordprocessor-coverage.xml
@@ -67,7 +63,6 @@ jobs:
6763
PYTHONPATH: ${{ github.workspace }}/backend/src:${{ github.workspace }}/backend/tests
6864
continue-on-error: true
6965
run: |
70-
poetry env use 3.11
7166
poetry install
7267
poetry run coverage run -m unittest discover -s "./tests" -p "*batch*.py" || echo "recordforwarder tests failed" >> ../failed_tests.txt
7368
poetry run coverage xml -o ../recordforwarder-coverage.xml
@@ -77,7 +72,6 @@ jobs:
7772
id: acklambda
7873
continue-on-error: true
7974
run: |
80-
poetry env use 3.10
8175
poetry install
8276
poetry run coverage run -m unittest discover || echo "ack-lambda tests failed" >> ../failed_tests.txt
8377
poetry run coverage xml -o ../ack-lambda-coverage.xml
@@ -89,7 +83,6 @@ jobs:
8983
PYTHONPATH: delta_backend/src:delta_backend/tests
9084
continue-on-error: true
9185
run: |
92-
poetry env use 3.11
9386
poetry install
9487
poetry run coverage run -m unittest discover || echo "delta tests failed" >> ../failed_tests.txt
9588
poetry run coverage xml -o ../delta-coverage.xml
@@ -101,7 +94,6 @@ jobs:
10194
id: fhirapi
10295
continue-on-error: true
10396
run: |
104-
poetry env use 3.11
10597
poetry install
10698
poetry run coverage run -m unittest discover || echo "fhir-api tests failed" >> ../failed_tests.txt
10799
poetry run coverage xml -o ../backend-coverage.xml
@@ -111,7 +103,6 @@ jobs:
111103
id: meshprocessor
112104
continue-on-error: true
113105
run: |
114-
poetry env use 3.10
115106
poetry install
116107
poetry run coverage run -m unittest discover || echo "mesh_processor tests failed" >> ../failed_tests.txt
117108
poetry run coverage xml -o ../mesh_processor-coverage.xml
@@ -123,7 +114,6 @@ jobs:
123114
PYTHONPATH: ${{ github.workspace }}/redis_sync/src:${{ github.workspace }}/redis_sync/tests
124115
continue-on-error: true
125116
run: |
126-
poetry env use 3.11
127117
poetry install
128118
poetry run coverage run -m unittest discover || echo "redis_sync tests failed" >> ../failed_tests.txt
129119
poetry run coverage xml -o ../redis_sync-coverage.xml

.tool-versions

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
poetry 2.1.2
2+
nodejs 23.11.0
3+
python 3.11.12

Makefile

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
SHELL=/usr/bin/env bash -euo pipefail
22

3+
PYTHON_PROJECT_DIRS_WITH_UNIT_TESTS = ack_backend backend delta_backend filenameprocessor mesh_processor recordprocessor redis_sync
4+
PYTHON_PROJECT_DIRS = e2e e2e_batch $(PYTHON_PROJECT_DIRS_WITH_UNIT_TESTS)
5+
36
#Installs dependencies using poetry.
47
install-python:
58
poetry lock --no-update
@@ -38,7 +41,7 @@ build-proxy:
3841
scripts/build_proxy.sh
3942

4043
#Files to loop over in release
41-
_dist_include="pytest.ini poetry.lock poetry.toml pyproject.toml Makefile build/. e2e e2e_batch specification sandbox terraform scripts backend delta_backend ack_backend filenameprocessor recordprocessor mesh_processor redis_sync lambdas/id_sync"
44+
_dist_include="pytest.ini poetry.lock poetry.toml pyproject.toml Makefile build/. specification sandbox terraform scripts $(PYTHON_PROJECT_DIRS)"
4245

4346

4447
#Create /dist/ sub-directory and copy files into directory
@@ -85,3 +88,39 @@ test-prod:
8588

8689
setup-python-envs:
8790
scripts/setup-python-envs.sh
91+
92+
initialise-all-python-venvs:
93+
for dir in $(PYTHON_PROJECT_DIRS); do ( \
94+
cd $$dir && \
95+
pwd && \
96+
rm -rf .venv && \
97+
python -m venv .venv && \
98+
source .venv/bin/activate && \
99+
poetry install --no-root && \
100+
deactivate \
101+
); done
102+
103+
update-all-python-dependencies:
104+
for dir in $(PYTHON_PROJECT_DIRS); do ( \
105+
cd $$dir && \
106+
pwd && \
107+
source .venv/bin/activate && \
108+
poetry update && \
109+
deactivate \
110+
); done
111+
112+
run-all-python-unit-tests:
113+
for dir in $(PYTHON_PROJECT_DIRS_WITH_UNIT_TESTS); do ( \
114+
cd $$dir && \
115+
pwd && \
116+
source .venv/bin/activate && \
117+
poetry run make test && \
118+
deactivate \
119+
); done
120+
121+
build-all-docker-images:
122+
for dir in $(PYTHON_PROJECT_DIRS_WITH_UNIT_TESTS); do \
123+
for dockerfile in $$(ls $$dir/*Dockerfile); do \
124+
echo $$dockerfile && docker build --file $$dockerfile $$dir; \
125+
done; \
126+
done

ack_backend/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
FROM public.ecr.aws/lambda/python:3.10 AS base
1+
FROM public.ecr.aws/lambda/python:3.11 AS base
22

33
RUN mkdir -p /home/appuser && \
44
echo 'appuser:x:1001:1001::/home/appuser:/sbin/nologin' >> /etc/passwd && \
55
echo 'appuser:x:1001:' >> /etc/group && \
6-
chown -R 1001:1001 /home/appuser && pip install "poetry~=1.5.0"
7-
6+
chown -R 1001:1001 /home/appuser && pip install "poetry~=2.1.2"
7+
88
COPY poetry.lock pyproject.toml README.md ./
99
RUN poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi --no-root --only main
1010
# -----------------------------

0 commit comments

Comments
 (0)