Skip to content

Commit

Permalink
Bump Python version to 3.12 (#598)
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentame authored Oct 20, 2024
1 parent 95261d4 commit 3183a8f
Show file tree
Hide file tree
Showing 41 changed files with 1,519 additions and 925 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ignore = E203,E501,W503
extend-ignore =
# Google Python style is not RST until after processed by Napoleon
RST201,RST203,RST301,
max-line-length = 80
max-line-length = 88
max-complexity = 10
docstring-convention = google
per-file-ignores = tests/*:S101
8 changes: 4 additions & 4 deletions .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pip==23.3.1
nox==2023.4.22
pip==24.2
nox==2024.4.15
nox-poetry==1.0.3
poetry==1.6.1
virtualenv==20.24.6
poetry==1.8.3
virtualenv==20.26.3
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4.7.1
with:
python-version: "3.11"
python-version: "3.12"

- name: Upgrade pip
run: |
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,23 @@ jobs:
fail-fast: false
matrix:
include:
- { python-version: "3.11", os: ubuntu-latest, session: "pre-commit" }
- { python-version: "3.11", os: ubuntu-latest, session: "safety" }
- { python-version: "3.12", os: ubuntu-latest, session: "pre-commit" }
- { python-version: "3.12", os: ubuntu-latest, session: "safety" }
- { python-version: "3.12", os: ubuntu-latest, session: "mypy" }
- { python-version: "3.11", os: ubuntu-latest, session: "mypy" }
- { python-version: "3.10", os: ubuntu-latest, session: "mypy" }
- { python-version: "3.9", os: ubuntu-latest, session: "mypy" }
- { python-version: "3.8", os: ubuntu-latest, session: "mypy" }
- { python-version: "3.12", os: ubuntu-latest, session: "tests" }
- { python-version: "3.11", os: ubuntu-latest, session: "tests" }
- { python-version: "3.10", os: ubuntu-latest, session: "tests" }
- { python-version: "3.9", os: ubuntu-latest, session: "tests" }
- { python-version: "3.8", os: ubuntu-latest, session: "tests" }
- { python-version: "3.11", os: windows-latest, session: "tests" }
- { python-version: "3.11", os: macos-latest, session: "tests" }
- { python-version: "3.11", os: ubuntu-latest, session: "typeguard" }
- { python-version: "3.11", os: ubuntu-latest, session: "xdoctest" }
- { python-version: "3.11", os: ubuntu-latest, session: "docs-build" }
- { python-version: "3.12", os: windows-latest, session: "tests" }
- { python-version: "3.12", os: macos-latest, session: "tests" }
- { python-version: "3.12", os: ubuntu-latest, session: "typeguard" }
- { python-version: "3.12", os: ubuntu-latest, session: "xdoctest" }
- { python-version: "3.12", os: ubuntu-latest, session: "docs-build" }

env:
NOXSESSION: ${{ matrix.session }}
Expand Down Expand Up @@ -105,10 +107,10 @@ jobs:
- name: Check out the repository
uses: actions/checkout@v4.1.1

- name: Set up Python 3.11
- name: Set up Python 3.12
uses: actions/setup-python@v4.7.1
with:
python-version: "3.11"
python-version: "3.12"

- name: Upgrade pip
run: |
Expand Down
10 changes: 2 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,19 @@ repos:
entry: end-of-file-fixer
language: system
types: [text]
stages: [commit, push, manual]
stages: [pre-commit, pre-push, manual]
- id: flake8
name: flake8
entry: flake8
language: system
types: [python]
require_serial: true
- id: reorder-python-imports
name: Reorder python imports
entry: reorder-python-imports
language: system
types: [python]
args: [--application-directories=src]
- id: trailing-whitespace
name: Trim Trailing Whitespace
entry: trailing-whitespace-fixer
language: system
types: [text]
stages: [commit, push, manual]
stages: [pre-commit, pre-push, manual]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.2.1
hooks:
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ python:
- requirements: docs/requirements.txt
- path: .
build:
os: ubuntu-22.04
os: ubuntu-24.04
tools:
python: "3.11"
python: "3.12"
7 changes: 7 additions & 0 deletions .safety-policy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: "2.0"

security:
ignore-vulnerabilities:
70612:
reason: Jinja2 utilisé seulement en interne pour la génération de documentation avec Sphinx
expires: "2025-09-01"
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Sphinx configuration."""

from datetime import datetime


Expand Down
14 changes: 7 additions & 7 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Nox sessions."""

import shutil
import sys
from pathlib import Path
Expand All @@ -20,8 +21,8 @@


package = "freebox_api"
python_versions = ["3.11", "3.10", "3.9", "3.8"]
nox.needs_version = ">= 2021.6.6"
python_versions = ["3.12", "3.11", "3.10", "3.9", "3.8"]
nox.needs_version = ">= 2024.4.15"
nox.options.sessions = (
"pre-commit",
"safety",
Expand Down Expand Up @@ -84,7 +85,7 @@ def activate_virtualenv_in_precommit_hooks(session: Session) -> None:
hook.write_text("\n".join(lines))


@session(name="pre-commit", python="3.11")
@session(name="pre-commit", python="3.12")
def precommit(session: Session) -> None:
"""Lint using pre-commit."""
args = session.posargs or ["run", "--all-files", "--show-diff-on-failure"]
Expand All @@ -99,14 +100,13 @@ def precommit(session: Session) -> None:
"pep8-naming",
"pre-commit",
"pre-commit-hooks",
"reorder-python-imports",
)
session.run("pre-commit", *args)
if args and args[0] == "install":
activate_virtualenv_in_precommit_hooks(session)


@session(python="3.11")
@session(python="3.12")
def safety(session: Session) -> None:
"""Scan dependencies for insecure packages."""
requirements = session.poetry.export_requirements()
Expand Down Expand Up @@ -167,7 +167,7 @@ def xdoctest(session: Session) -> None:
session.run("python", "-m", "xdoctest", package, *args)


@session(name="docs-build", python="3.11")
@session(name="docs-build", python="3.12")
def docs_build(session: Session) -> None:
"""Build the documentation."""
args = session.posargs or ["docs", "docs/_build"]
Expand All @@ -181,7 +181,7 @@ def docs_build(session: Session) -> None:
session.run("sphinx-build", *args)


@session(python="3.11")
@session(python="3.12")
def docs(session: Session) -> None:
"""Build and serve the documentation with live reloading on file changes."""
args = session.posargs or ["--open-browser", "docs", "docs/_build"]
Expand Down
Loading

0 comments on commit 3183a8f

Please sign in to comment.