From f047943eb7ae1933ee13a4cb2f0fdc658bbfe674 Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Sat, 1 Feb 2025 16:11:44 +0100 Subject: [PATCH 1/4] [CHANGE] Define language versions --- .pre-commit-config.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 91268822..3f2e7f21 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,6 +3,11 @@ # Update this file: # pre-commit autoupdate +# Set the default language versions for the hooks +default_language_version: + python: python3 # Force all Python hooks to use Python 3 + node: 22.12.0 # Force all Node hooks to use Node 22.12.0 + repos: # Code Upgrades - repo: https://github.com/asottile/pyupgrade @@ -81,6 +86,7 @@ repos: rev: v0.41.0 hooks: - id: markdownlint + language: node args: - --disable=MD013 # Infrastructure From 8be2760fc4c31ac733e71eae2908a35816d575fb Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Sat, 1 Feb 2025 16:14:36 +0100 Subject: [PATCH 2/4] [CHANGNE] Update repos and dependencies --- .pre-commit-config.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3f2e7f21..5362b10d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,19 +11,19 @@ default_language_version: repos: # Code Upgrades - repo: https://github.com/asottile/pyupgrade - rev: v3.15.2 + rev: v3.19.1 hooks: - id: pyupgrade args: [--py38-plus] - repo: https://github.com/adamchainz/django-upgrade - rev: 1.17.0 + rev: 1.22.2 hooks: - id: django-upgrade args: [--target-version=4.2] # Formatting - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: # Identify invalid files - id: check-ast @@ -70,7 +70,7 @@ repos: static/(.*)/libs/ ) - repo: https://github.com/editorconfig-checker/editorconfig-checker.python - rev: 2.7.3 + rev: 3.2.0 hooks: - id: editorconfig-checker exclude: | @@ -83,7 +83,7 @@ repos: static/(.*)/libs/ ) - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.41.0 + rev: v0.44.0 hooks: - id: markdownlint language: node @@ -91,7 +91,7 @@ repos: - --disable=MD013 # Infrastructure - repo: https://github.com/tox-dev/pyproject-fmt - rev: 2.1.3 + rev: v2.5.0 hooks: - id: pyproject-fmt name: pyproject.toml formatter @@ -99,9 +99,9 @@ repos: args: - --indent=4 additional_dependencies: - - tox==4.15.0 # https://github.com/tox-dev/tox/releases/latest + - tox==4.24.1 # https://github.com/tox-dev/tox/releases/latest - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.18 + rev: v0.23 hooks: - id: validate-pyproject name: Validate pyproject.toml From b5ad1c8a1a3ccef6e665517c80702a3abc4ba082 Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Sat, 1 Feb 2025 16:18:08 +0100 Subject: [PATCH 3/4] [CHANGE] Use global exclude instead of per hook --- .pre-commit-config.yaml | 41 ++++++++++++++--------------------------- 1 file changed, 14 insertions(+), 27 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5362b10d..51c69b69 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,6 +8,20 @@ default_language_version: python: python3 # Force all Python hooks to use Python 3 node: 22.12.0 # Force all Node hooks to use Node 22.12.0 +# Globally exclude files +# https://pre-commit.com/#top_level-exclude +exclude: | + (?x)( + LICENSE| + allianceauth\/static\/allianceauth\/css\/themes\/bootstrap-locals.less| + \.min\.css| + \.min\.js| + \.po| + \.mo| + swagger\.json| + static/(.*)/libs/ + ) + repos: # Code Upgrades - repo: https://github.com/asottile/pyupgrade @@ -49,39 +63,12 @@ repos: args: [--fix=lf] - id: trailing-whitespace args: [--markdown-linebreak-ext=md] - exclude: | - (?x)( - \.min\.css| - \.min\.js| - \.po| - \.mo| - swagger\.json| - static/(.*)/libs/ - ) - id: check-executables-have-shebangs - id: end-of-file-fixer - exclude: | - (?x)( - \.min\.css| - \.min\.js| - \.po| - \.mo| - swagger\.json| - static/(.*)/libs/ - ) - repo: https://github.com/editorconfig-checker/editorconfig-checker.python rev: 3.2.0 hooks: - id: editorconfig-checker - exclude: | - (?x)( - LICENSE| - allianceauth\/static\/allianceauth\/css\/themes\/bootstrap-locals.less| - \.po| - \.mo| - swagger\.json| - static/(.*)/libs/ - ) - repo: https://github.com/igorshubovych/markdownlint-cli rev: v0.44.0 hooks: From c2ae680f72f5cfe5c97bd13f91cc540cbb9a8cb9 Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Sat, 1 Feb 2025 16:22:36 +0100 Subject: [PATCH 4/4] [CHANGE] Apply new pre-commit config --- pyproject.toml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3ed04b9c..c6f73359 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [build-system] build-backend = "flit_core.buildapi" requires = [ - "flit-core<4,>=3.2", + "flit-core>=3.2,<4", ] [project] @@ -31,6 +31,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", ] @@ -41,15 +42,15 @@ dynamic = [ dependencies = [ "bcrypt", "beautifulsoup4", - "celery<6,>=5.2", + "celery>=5.2,<6", "celery-once>=3.0.1", - "django<5,>=4.2", + "django>=4.2,<5", "django-bootstrap-form", "django-bootstrap5>=23.3", "django-celery-beat>=2.3", "django-esi>=5", "django-redis>=5.2", - "django-registration<3.4,>=3.3", + "django-registration>=3.3,<3.4", "django-solo", "django-sortedm2m", "django-sri", @@ -70,7 +71,7 @@ optional-dependencies.docs = [ "myst-parser", "sphinx", "sphinx-copybutton", - "sphinx-rtd-theme<3,>=2", + "sphinx-rtd-theme>=2,<3", "sphinx-tabs", "sphinxcontrib-django", ]