Skip to content

Commit

Permalink
TG-1012 Upgrade cookiecut project to Python 3.12 (#296)
Browse files Browse the repository at this point in the history
  • Loading branch information
niccolomineo authored Jan 8, 2024
1 parent ffd2dbf commit 4ec1a17
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion {{cookiecutter.project_dirname}}/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
default_language_version:
python: python3.11
python: python3.12
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.5.0"
Expand Down
6 changes: 3 additions & 3 deletions {{cookiecutter.project_dirname}}/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.11-slim-bullseye AS base
FROM python:3.12-slim-bookworm AS base

LABEL company="20tab" project="{{ cookiecutter.project_slug }}" service="backend" stage="base"
ARG DEBIAN_FRONTEND=noninteractive
Expand All @@ -8,7 +8,7 @@ WORKDIR $WORKDIR
RUN useradd --skel /dev/null --create-home $APPUSER
RUN chown $APPUSER:$APPUSER $WORKDIR
ENV PATH="/home/${APPUSER}/.local/bin:${PATH}"
ARG PACKAGES_PATH=/home/${APPUSER}/.local/lib/python3.11/site-packages
ARG PACKAGES_PATH=/home/${APPUSER}/.local/lib/python3.12/site-packages
RUN apt-get update \
&& apt-get install --assume-yes --no-install-recommends \
libpq5 \
Expand Down Expand Up @@ -45,7 +45,7 @@ FROM base AS remote
LABEL company="20tab" project="{{ cookiecutter.project_slug }}" service="backend" stage="remote"
ENV DJANGO_CONFIGURATION=Remote INTERNAL_SERVICE_PORT={{ cookiecutter.internal_service_port }}
USER $APPUSER
ARG PACKAGES_PATH=/home/${APPUSER}/.local/lib/python3.11/site-packages
ARG PACKAGES_PATH=/home/${APPUSER}/.local/lib/python3.12/site-packages
COPY --chown=$APPUSER ./requirements/remote.txt requirements/remote.txt
RUN python3 -m pip install --user --no-cache-dir -r requirements/remote.txt \
&& find ${PACKAGES_PATH}/boto*/data/* -maxdepth 0 -type d -not -name s3* -exec rm -rf {} \; || true
Expand Down
6 changes: 3 additions & 3 deletions {{cookiecutter.project_dirname}}/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.black]
target-version = ["py311"]
target-version = ["py312"]

[tool.pytest.ini_options]
DJANGO_CONFIGURATION = "Testing"
Expand Down Expand Up @@ -34,7 +34,7 @@ enable_error_code = [
"truthy-bool",
]
ignore_missing_imports = true
python_version = "3.11"
python_version = "3.12"

[tool.bandit]
exclude_dirs = [
Expand Down Expand Up @@ -79,7 +79,7 @@ select = [
"W",
"B9"
]
target-version = "py311"
target-version = "py312"

[tool.ruff.per-file-ignores]
"{{ cookiecutter.django_settings_dirname }}/*sgi.py" = ["E402"]
Expand Down

0 comments on commit 4ec1a17

Please sign in to comment.