Skip to content

Commit

Permalink
TG-1012 Upgrade to Python 3.12 (#293)
Browse files Browse the repository at this point in the history
Co-authored-by: Paolo Melchiorre <paolo@melchiorre.org>
  • Loading branch information
niccolomineo and pauloxnet committed Jan 10, 2024
1 parent 4904e65 commit 8422449
Show file tree
Hide file tree
Showing 15 changed files with 1,231 additions and 1,206 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/publish-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v5
with:
images: 20tab/talos-django
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }},20tab/talos-nextjs:latest
tags: ${{ steps.meta.outputs.tags }},20tab/talos-django:latest
labels: ${{ steps.meta.outputs.labels }}
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
default_language_version:
python: python3.11
python: python3.12
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.4.0"
rev: "v4.5.0"
hooks:
- id: check-added-large-files
args: ["--maxkb=1024"]
Expand All @@ -26,33 +26,33 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.261
rev: v0.1.11
hooks:
- id: ruff
exclude: ^\{\{cookiecutter\.project_dirname\}\}.*$
args:
- --fix
- repo: https://github.com/psf/black
rev: "23.3.0"
rev: "23.12.1"
hooks:
- id: black
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "0.9.2"
rev: "1.5.3"
hooks:
- id: pyproject-fmt
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.0-alpha.6"
rev: "v3.1.0"
hooks:
- id: prettier
exclude: ^\{\{cookiecutter\.project_dirname\}\}.*$
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.1.1"
rev: "v1.8.0"
hooks:
- id: mypy
args: ["--no-site-packages"]
exclude: ^\{\{cookiecutter\.project_dirname\}\}.*$
- repo: https://github.com/pycqa/bandit
rev: "1.7.5"
rev: "1.7.6"
hooks:
- id: bandit
additional_dependencies: ["bandit[toml]"]
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.11-slim-bullseye
FROM python:3.12-slim-bookworm

ARG DEBIAN_FRONTEND=noninteractive
ARG OUTPUT_BASE_DIR=/data
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pip: pip_update ## Compile requirements

.PHONY: pip_update
pip_update: ## Update requirements and dependencies
python3 -m pip install --quiet --upgrade pip~=23.0.0 pip-tools~=6.12.0 setuptools~=67.6.0 wheel~=0.40.0
python3 -m pip install --quiet --upgrade pip~=23.3.0 pip-tools~=7.3.0 setuptools~=69.0.0 wheel~=0.42.0

.PHONY: precommit
precommit: ## Fix code formatting, linting and sorting imports
Expand Down
25 changes: 19 additions & 6 deletions 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.coverage.html]
title = "Django Continuous Delivery - Coverage"
Expand All @@ -22,17 +22,21 @@ enable_error_code = [
"truthy-bool",
]
ignore_missing_imports = true
python_version = "3.11"
python_version = "3.12"

[tool.bandit]
exclude_dirs = [".venv", "tests", "features"]
exclude_dirs = [
".venv",
"tests",
"features"
]

[tool.ruff]
extend-exclude = [
"__pycache__",
".vscode*",
]
extend-ignore = [
ignore = [
"D203",
"D212",
"D213",
Expand All @@ -51,8 +55,17 @@ extend-ignore = [
"D416",
"D417",
]
select = ["A", "B", "C", "D", "E", "F", "I", "W", "B9"]
target-version = "py311"
select = [
"B",
"C",
"D",
"E",
"F",
"I",
"W",
"B9"
]
target-version = "py312"

[tool.ruff.isort]
known-first-party = [
Expand Down
6 changes: 2 additions & 4 deletions requirements/common.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
black~=23.3.0
click~=8.1.0
cookiecutter~=2.1.0
pip-tools~=6.12.0
cookiecutter~=2.5.0
pydantic~=1.10.0
types-python-slugify~=8.0.0
python-slugify~=8.0.0
validators~=0.20.0
Loading

0 comments on commit 8422449

Please sign in to comment.