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

Upgrade to Python 3.12 #4553

Merged
merged 8 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
uses: maykinmedia/[email protected]
with:
apt-packages: 'libxml2 libxmlsec1 libxmlsec1-openssl gettext postgresql-client gdal-bin'
python-version: '3.10'
python-version: '3.12'
optimize-postgres: 'yes'
pg-service: 'postgres'
setup-node: 'yes'
Expand Down Expand Up @@ -143,7 +143,7 @@ jobs:
uses: maykinmedia/[email protected]
with:
apt-packages: 'libxml2 libxmlsec1 libxmlsec1-openssl gettext postgresql-client gdal-bin'
python-version: '3.10'
python-version: '3.12'
optimize-postgres: 'yes'
pg-service: 'postgres'
setup-node: 'yes'
Expand Down Expand Up @@ -221,7 +221,7 @@ jobs:
uses: maykinmedia/[email protected]
with:
apt-packages: 'libxml2 libxmlsec1 libxmlsec1-openssl gettext postgresql-client gdal-bin'
python-version: '3.10'
python-version: '3.12'
optimize-postgres: 'yes'
pg-service: 'postgres'
setup-node: 'yes'
Expand Down Expand Up @@ -292,7 +292,7 @@ jobs:
uses: maykinmedia/[email protected]
with:
apt-packages: 'libxml2 libxmlsec1 libxmlsec1-openssl gdal-bin'
python-version: '3.10'
python-version: '3.12'
setup-node: 'no'
working-directory: 'open-forms'

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/code_quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
uses: maykinmedia/[email protected]
with:
apt-packages: 'libxml2 libxmlsec1 libxmlsec1-openssl gdal-bin'
python-version: '3.10'
python-version: '3.12'
setup-node: 'no'
- uses: isort/[email protected]
with:
Expand All @@ -49,7 +49,7 @@ jobs:
uses: maykinmedia/[email protected]
with:
apt-packages: 'libxml2 libxmlsec1 libxmlsec1-openssl gdal-bin'
python-version: '3.10'
python-version: '3.12'
setup-node: 'no'
- name: Run black
run: |
Expand All @@ -65,7 +65,7 @@ jobs:
uses: maykinmedia/[email protected]
with:
apt-packages: 'libxml2 libxmlsec1 libxmlsec1-openssl gdal-bin'
python-version: '3.10'
python-version: '3.12'
setup-node: 'no'
- name: Run flake8
id: flake8
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:
uses: maykinmedia/[email protected]
with:
apt-packages: 'libxml2 libxmlsec1 libxmlsec1-openssl gdal-bin'
python-version: '3.10'
python-version: '3.12'
setup-node: 'no'
- name: Run manage.py makemigrations --check --dry-run
run: |
Expand Down Expand Up @@ -140,7 +140,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'

- name: Run linter
run: python ./bin/lint_dependencies.py
Expand All @@ -153,7 +153,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'
- name: Install additional dependencies
run: |
pip install uv
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dockerhub-description.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'
cache: 'pip'
cache-dependency-path: 'docker/ci/requirements.txt'
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
uses: maykinmedia/[email protected]
with:
apt-packages: 'libxml2 libxmlsec1 libxmlsec1-openssl gdal-bin'
python-version: '3.10'
python-version: '3.12'
optimize-postgres: 'no'
setup-node: 'yes'
npm-ci-flags: '--legacy-peer-deps'
Expand Down
5 changes: 3 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ sphinx:
configuration: docs/conf.py

build:
os: 'ubuntu-20.04'
os: 'ubuntu-22.04'
apt_packages:
- libxml2-dev
- libxmlsec1-dev
- libxmlsec1-openssl
- wget
- libmagic1
tools:
python: '3.10'
python: '3.12'
jobs:
post_checkout:
- bash bin/rtd_post_checkout.sh
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ FROM openformulieren/open-forms-sdk:${SDK_RELEASE} as sdk-image

# Stage 1 - Backend build environment
# includes compilers and build tooling to create the environment
FROM python:3.10-slim-bookworm AS backend-build
FROM python:3.12-slim-bookworm AS backend-build

RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends \
pkg-config \
Expand Down Expand Up @@ -39,7 +39,7 @@ COPY ./patches /tmp/patches
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
&& rm -rf /var/lib/apt/lists/* \
&& /tmp/patches/apply.sh /usr/local/lib/python3.10/site-packages
&& /tmp/patches/apply.sh /usr/local/lib/python3.12/site-packages

# Stage 2 - Install frontend deps and build assets
FROM node:20-bookworm-slim AS frontend-build
Expand All @@ -60,7 +60,7 @@ COPY ./src /app/src
RUN npm run build

# Stage 3 - Build docker image suitable for production
FROM python:3.10-slim-bookworm
FROM python:3.12-slim-bookworm

# Stage 3.1 - Set up the needed production dependencies
# install all the dependencies for GeoDjango
Expand Down Expand Up @@ -94,7 +94,7 @@ COPY ./bin/check_celery_worker_liveness.py ./bin/report_component_problems.py ./
VOLUME ["/app/log", "/app/media", "/app/private_media", "/app/certifi_ca_bundle"]

# copy backend build deps
COPY --from=backend-build /usr/local/lib/python3.10 /usr/local/lib/python3.10
COPY --from=backend-build /usr/local/lib/python3.12 /usr/local/lib/python3.12
COPY --from=backend-build /usr/local/bin/uwsgi /usr/local/bin/uwsgi
COPY --from=backend-build /usr/local/bin/celery /usr/local/bin/celery

Expand Down
2 changes: 1 addition & 1 deletion INSTALL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Prerequisites

You need the following libraries and/or programs:

* `Python`_ 3.10
* `Python`_ 3.12
* Python `Virtualenv`_ and `Pip`_
* `PostgreSQL`_ 10 or above
* `Redis`_ for `Celery`_ to work
Expand Down
2 changes: 1 addition & 1 deletion pyright.pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ exclude = [
]
ignore = []

pythonVersion = "3.10"
pythonVersion = "3.12"
pythonPlatform = "Linux"
2 changes: 1 addition & 1 deletion requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ lxml-html-clean
O365 # microsoft graph
Pillow # handle images
portalocker[redis]
psycopg2 # database driver
psycopg # database driver
python-dotenv # environment variables for secrets
python-decouple # processing of envvar configs
python-magic
Expand Down
27 changes: 10 additions & 17 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ asgiref==3.7.2
# via django
asn1crypto==1.5.1
# via webauthn
async-timeout==4.0.2
# via redis
attrs==23.2.0
# via
# glom
Expand Down Expand Up @@ -156,7 +154,7 @@ django-csp-reports==1.8.1
# via -r requirements/base.in
django-digid-eherkenning==0.16.0
# via -r requirements/base.in
django-filter==23.2
django-filter==24.2
# via -r requirements/base.in
django-flags==5.0.13
# via -r requirements/base.in
Expand Down Expand Up @@ -192,7 +190,7 @@ django-redis==5.3.0
# via -r requirements/base.in
django-relativedelta==2.0.0
# via zgw-consumers
django-sendfile2==0.7.0
django-sendfile2==0.7.1
# via django-privates
django-sessionprofile==2.0.0
# via django-digid-eherkenning
Expand Down Expand Up @@ -267,8 +265,6 @@ humanize==3.14.0
# via flower
idna==3.7
# via requests
importlib-resources==6.4.0
# via schwifty
inflection==0.5.1
# via
# django-camunda
Expand All @@ -280,7 +276,7 @@ isodate==0.6.1
# zeep
josepy==1.14.0
# via mozilla-django-oidc
jq==1.3.0
jq==1.7.0
# via -r requirements/base.in
jsonschema==4.21.1
# via
Expand Down Expand Up @@ -342,7 +338,7 @@ openapi-spec-validator==0.6.0
# via openapi3-parser
openapi3-parser==1.1.16
# via -r requirements/base.in
openpyxl==3.0.7
openpyxl==3.1.5
# via tablib
orderedmultidict==1.0.1
# via furl
Expand All @@ -367,7 +363,7 @@ prometheus-client==0.13.1
# via flower
prompt-toolkit==3.0.27
# via click-repl
psycopg2==2.8.6
psycopg==3.2.1
# via -r requirements/base.in
pycountry==23.12.11
# via schwifty
Expand All @@ -385,7 +381,7 @@ pyphen==0.14.0
# via weasyprint
pypng==0.20220715.0
# via qrcode
python-dateutil==2.8.2
python-dateutil==2.9.0.post0
# via
# celery
# django-camunda
Expand All @@ -397,7 +393,7 @@ python-dotenv==0.14.0
# via -r requirements/base.in
python-magic==0.4.27
# via -r requirements/base.in
pytz==2022.2.1
pytz==2024.1
# via
# django-yubin
# flower
Expand Down Expand Up @@ -451,9 +447,9 @@ rpds-py==0.18.0
# referencing
rstr==3.2.2
# via schwifty
ruamel-yaml==0.17.32
ruamel-yaml==0.18.6
# via prance
ruamel-yaml-clib==0.2.7
ruamel-yaml-clib==0.2.8
# via ruamel-yaml
schwifty==2024.5.3
# via -r requirements/base.in
Expand Down Expand Up @@ -501,12 +497,9 @@ tornado==6.4.1
typing-extensions==4.11.0
# via
# -r requirements/base.in
# asgiref
# django-modeltranslation
# django-solo
# mozilla-django-oidc-db
# psycopg
# qrcode
# schwifty
# zgw-consumers
tzdata==2023.3
# via
Expand Down
Loading
Loading