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

Python 3.12 second try #2392

Draft
wants to merge 38 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
37a1f5e
upgrade to python 3.12
sastels Nov 15, 2024
17fa3b1
use poetry.lock from main
sastels Nov 18, 2024
df8e808
Merge branch 'main' into chore/python-3.12
sastels Nov 18, 2024
cc9365a
freeze requirements
sastels Nov 18, 2024
436cf74
add CYPRESS_USER_PW_SECRET override to dev config
sastels Nov 18, 2024
0b4fa4f
fix two tests
sastels Nov 18, 2024
bcb270a
another file but the same as the first so easy peasy
sastels Nov 18, 2024
d04db82
more fixing
sastels Nov 18, 2024
a7bae4e
format
sastels Nov 18, 2024
9b98f8b
turn on REDIS_ENABLED
sastels Nov 18, 2024
6e0242a
ai [review] plz
sastels Nov 18, 2024
c355c3c
ai suggestions
sastels Nov 18, 2024
5b2a961
replace .not_called()
sastels Nov 18, 2024
788e15b
Merge branch 'fix/tests-using-called_once_with' of github.com:cds-snc…
sastels Nov 18, 2024
a3e2537
tests passing
sastels Nov 19, 2024
f0d1a66
Merge branch 'main' into chore/python-3.12
sastels Nov 19, 2024
fe7cda9
use waffles from 3.12 endpoint
sastels Nov 19, 2024
9d9f441
3.12.7
sastels Nov 25, 2024
2c6b7b9
Merge branch 'main' into chore/python-3.12
sastels Nov 27, 2024
79dd541
freeze requirements
sastels Nov 27, 2024
f3cf0fc
Merge branch 'main' into chore/python-3.12
sastels Nov 27, 2024
0f72da3
fix tests
sastels Nov 28, 2024
2dd4af3
Merge branch 'chore/python-3.12' of github.com:cds-snc/notification-a…
sastels Nov 28, 2024
94b1c25
Merge branch 'main' into chore/python-3.12
sastels Nov 28, 2024
83d8d7a
all tests passing
sastels Nov 28, 2024
b465056
Merge branch 'chore/python-3.12' of github.com:cds-snc/notification-a…
sastels Nov 28, 2024
19cd8d8
use utils 53.0.0
sastels Dec 2, 2024
5d7ec47
use waffles 53.0.0
sastels Dec 2, 2024
5c28e90
use utils 53.0.1
sastels Dec 2, 2024
fbb3dc4
ai [review] plz
sastels Dec 3, 2024
9db6835
add docker image sha
sastels Dec 4, 2024
d46c68a
libexecinfo not supported in alpine 3.20 but I don't think we're usin…
sastels Dec 4, 2024
bfb5ab9
Merge branch 'main' into chore/python-3.12
sastels Dec 5, 2024
8c3ebda
lambda docker image builds
sastels Dec 5, 2024
44ca59e
use debian-slim
sastels Dec 12, 2024
6b56600
Merge branch 'main' of github.com:cds-snc/notification-api into pytho…
sastels Dec 13, 2024
03d9361
Merge branch 'main' into python-3.12-second-try
sastels Dec 16, 2024
77fdd8c
Merge branch 'main' into python-3.12-second-try
sastels Dec 17, 2024
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
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/vscode/devcontainers/python:0-3.10@sha256:ef9cc483a593c95e1e83f2cf00b6a0e1ec7df43344416a41ccb3a88aef27beac
FROM mcr.microsoft.com/vscode/devcontainers/python:3.12

ARG KUBENS_VERSION="0.9.4"
ENV POETRY_VERSION="1.7.1"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
- name: Install libcurl
run: sudo apt-get update && sudo apt-get install libssl-dev libcurl4-openssl-dev
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up Python 3.10
- name: Set up Python 3.12
uses: actions/setup-python@b64ffcaf5b410884ad320a9cfac8866006a109aa # v4.8.0
with:
python-version: '3.10'
python-version: '3.12'
- name: Upgrade pip
run: python -m pip install --upgrade pip
- uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3.3.3
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
- name: Install libcurl
run: sudo apt-get update && sudo apt-get install libssl-dev libcurl4-openssl-dev
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up Python 3.10
- name: Set up Python 3.12
uses: actions/setup-python@b64ffcaf5b410884ad320a9cfac8866006a109aa # v4.8.0
with:
python-version: '3.10'
python-version: '3.12'
- name: Upgrade pip
run: python -m pip install --upgrade pip
- uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3.3.3
Expand Down Expand Up @@ -62,14 +62,14 @@ jobs:
working-directory: ${{ github.workspace }}
shell: bash
run: |
mkdir -p "${{ github.workspace }}/env/" && cp -fR $(poetry env list | poetry env info -p)/lib/python3.10/site-packages "${{ github.workspace }}/env/"
mkdir -p "${{ github.workspace }}/env/" && cp -fR $(poetry env list | poetry env info -p)/lib/python3.12/site-packages "${{ github.workspace }}/env/"
- name: Install development .env file
working-directory: ${{ github.workspace }}
shell: bash
run: |
cp -f .env.example .env
- name: Checks for new endpoints against AWS WAF rules
uses: cds-snc/notification-utils/.github/actions/waffles@52.4.0
uses: cds-snc/notification-utils/.github/actions/waffles@53.0.1
with:
app-loc: '/github/workspace'
app-libs: '/github/workspace/env/site-packages'
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Run `make run-celery-local` or `make run-celery-local-filtered`. Note that the "

### Python version

This codebase is Python 3 only. At the moment we run 3.10.8 in production. You will run into problems if you try to use Python 3.4 or older.
This codebase is Python 3 only. At the moment we run 3.12.7 in production. You will run into problems if you try to use Python 3.4 or older.

### To run Performance tests

Expand Down Expand Up @@ -121,7 +121,7 @@ createuser -l -s postgres

__Problem__ : `E999 SyntaxError: invalid syntax` when running `flake8`

__Solution__ : Check that you are in your correct virtualenv, with python 3.10
__Solution__ : Check that you are in your correct virtualenv, with python 3.12

---

Expand Down
1 change: 1 addition & 0 deletions app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,7 @@ class Development(Config):
SRE_CLIENT_SECRET = os.getenv("SRE_CLIENT_SECRET", "dev-notify-secret-key")
CACHE_CLEAR_CLIENT_SECRET = os.getenv("CACHE_CLEAR_CLIENT_SECRET", "dev-notify-cache-client-secret")
CYPRESS_AUTH_CLIENT_SECRET = os.getenv("CYPRESS_AUTH_CLIENT_SECRET", "dev-notify-cypress-secret-key")
CYPRESS_USER_PW_SECRET = os.getenv("CYPRESS_USER_PW_SECRET", "dev-notify-cypress-secret-key")

NOTIFY_ENVIRONMENT = "development"
NOTIFICATION_QUEUE_PREFIX = os.getenv("NOTIFICATION_QUEUE_PREFIX", "notification-canada-ca")
Expand Down
6 changes: 4 additions & 2 deletions bin/get_newrelic_layer.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/bash

# see https://layers.newrelic-external.com/

aws lambda get-layer-version-by-arn \
--region ca-central-1 \
--arn arn:aws:lambda:ca-central-1:451483290750:layer:NewRelicPython310:39 \
--arn arn:aws:lambda:ca-central-1:451483290750:layer:NewRelicPython312:22 \
| jq -r '.Content.Location' \
| xargs curl -o ../newrelic-layer.zip
| xargs curl -o ../newrelic-layer.zip
2 changes: 1 addition & 1 deletion ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.10-alpine3.16@sha256:afe68972cc00883d70b3760ee0ffbb7375cf09706c122dda7063ffe64c5be21b
FROM python:3.12-alpine3.20@sha256:5049c050bdc68575a10bcb1885baa0689b6c15152d8a56a7e399fb49f783bf98

ENV PYTHONDONTWRITEBYTECODE 1
ENV APP_VENV="/app/.venv"
Expand Down
4 changes: 2 additions & 2 deletions ci/Dockerfile.lambda
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM python:3.10-slim@sha256:61912260e578182d00b5e163eb4cfb13b35fb8782c98d1df9ed584cec8939097
FROM python:3.12-slim@sha256:2b0079146a74e23bf4ae8f6a28e1b484c6292f6fb904cbb51825b4a19812fcd8

ENV PYTHONPATH "${PYTHONPATH}:/opt/python/lib/python3.10/site-packages"
ENV PYTHONPATH "${PYTHONPATH}:/opt/python/lib/python3.12/site-packages"
ENV PYTHONDONTWRITEBYTECODE 1
ENV TASK_ROOT /app
ENV APP_VENV="${TASK_ROOT}/.venv"
Expand Down
2 changes: 1 addition & 1 deletion ci/Dockerfile.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Heavily inspired from Dockerfile, this one also install requirements_for_test.txt

FROM python:3.10-alpine@sha256:7edffe5acc6a2c4c009fece2fbdc85f04fde4c8481202473b880ef3f8fbb2939
FROM python:3.12-alpine3.20@sha256:5049c050bdc68575a10bcb1885baa0689b6c15152d8a56a7e399fb49f783bf98

ENV PYTHONDONTWRITEBYTECODE 1
ENV POETRY_VERSION "1.7.1"
Expand Down
2 changes: 1 addition & 1 deletion local/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.10-alpine@sha256:7edffe5acc6a2c4c009fece2fbdc85f04fde4c8481202473b880ef3f8fbb2939
FROM python:3.12-alpine3.20@sha256:5049c050bdc68575a10bcb1885baa0689b6c15152d8a56a7e399fb49f783bf98

ENV PYTHONDONTWRITEBYTECODE 1
ENV POETRY_VERSION "1.7.1"
Expand Down
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[mypy]
python_version = 3.10
python_version = 3.12

[mypy-pytest.*]
ignore_missing_imports = True
Expand Down
Binary file modified newrelic-layer.zip
Binary file not shown.
Loading
Loading