Skip to content

Commit

Permalink
TG-1012 Upgrade to Python 3.12 (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
niccolomineo authored Jan 10, 2024
1 parent 37c27b8 commit 3b3b15f
Show file tree
Hide file tree
Showing 14 changed files with 1,236 additions and 1,220 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/publish-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ 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-nextjs
- 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
Expand Down
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 -r requirements/test.txt
Expand Down
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
default_language_version:
python: python3.11
python: python3.12
exclude: ^(\{\{cookiecutter\.project_dirname\}\}.*)$
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,26 +26,26 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/asottile/pyupgrade
rev: "v3.3.1"
rev: "v3.15.0"
hooks:
- id: pyupgrade
args: [--py311-plus]
args: [--py312-plus]
- repo: https://github.com/psf/black
rev: "22.12.0"
rev: "23.12.1"
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.0-alpha.4"
rev: "v3.1.0"
hooks:
- id: prettier
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.225
rev: v0.1.11
hooks:
- id: ruff
args:
- --fix
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v0.991"
rev: "v1.8.0"
hooks:
- id: mypy
args: ["--no-site-packages"]
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 -q -U pip~=22.3.0 pip-tools~=6.12.0 setuptools~=66.0.0 wheel~=0.38.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
19 changes: 14 additions & 5 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 = "Talos - Coverage"
Expand All @@ -21,15 +21,15 @@ source = ["."]
enable_error_code = [
"truthy-bool",
]
python_version = "3.11"
python_version = "3.12"
ignore_missing_imports = true

[tool.ruff]
extend-exclude = [
"__pycache__",
".vscode*",
]
extend-ignore = [
ignore = [
"D203",
"D212",
"D213",
Expand All @@ -49,8 +49,17 @@ ignore_missing_imports = true
"D417",
"E501",
]
select = ["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]
combine-as-imports = true
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~=22.12.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~=7.0.0
python-slugify~=8.0.0
validators~=0.20.0
605 changes: 293 additions & 312 deletions requirements/common.txt

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions requirements/local.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-r test.in
ipython~=8.8.0
pre-commit~=2.21.0
black~=23.12.0
ipython~=8.20.0
pip-tools~=7.3.0
pre-commit~=3.6.0
types-python-slugify~=8.0.0
960 changes: 501 additions & 459 deletions requirements/local.txt

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions requirements/test.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-r common.in
coverage[toml]~=7.0.0
mypy~=0.991
ruff~=0.0.0
coverage[toml]~=7.4.0
mypy~=1.8.0
ruff~=0.1.0
814 changes: 399 additions & 415 deletions requirements/test.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/test_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class TestBootstrapCollector(TestCase):
maxDiff = None

def setUp(self):
"""Setup the test data."""
"""Set up the test data."""
self.output_dir = Path("./tests/test_files")
rmtree(self.output_dir, ignore_errors=True)
return super().setUp()
Expand Down
1 change: 0 additions & 1 deletion {{cookiecutter.project_dirname}}/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
version: "3.9"

services:

consumer:
environment:
- INTERNAL_BACKEND_URL=${INTERNAL_BACKEND_URL:-http://provider:8000}
Expand Down

0 comments on commit 3b3b15f

Please sign in to comment.