Skip to content

Commit f2ec8f9

Browse files
rh0diumclaude
andauthored
Update for Python 3.14 and Django 6.0 readiness (#7)
* Update for Python 3.14 and Django 6.0 readiness - Update pyproject.toml classifiers for Python 3.12/3.13/3.14 and Django 5.2/6.0 - Update requires-python to >=3.12 - Modernize ruff configuration with proper lint and format sections - Update black target-version to py312 - Update pre-commit hooks to v5.0.0 and ruff to v0.8.3 - Update GitHub CI test matrix for Python 3.12/3.13/3.14 and Django 5.2/6.0 - Add continue-on-error for Django 6.0 and Python 3.14 in CI 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Update CI workflow: remove Black/pre-commit, add merge queue support - Add merge_group trigger for merge queue support - Remove redundant Black and pre-commit jobs - Update Ruff job to include both format and lint checks - Rename job to "Ruff Format" for clarity - Add always() pattern to release job to prevent skip propagation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Update ruff to v0.14.8 and fix formatting 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent dffa62e commit f2ec8f9

3 files changed

Lines changed: 38 additions & 58 deletions

File tree

.github/workflows/main.yml

Lines changed: 15 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Django States Tests
22

33
on:
44
push:
5+
merge_group:
56
schedule:
67
- cron: '0 1 * * 5'
78

@@ -29,27 +30,8 @@ jobs:
2930
- name: outdated
3031
run: pip list --outdated --not-required --user | grep . && echo "There are outdated packages" && exit 1 || echo "All packages up to date"
3132

32-
black:
33-
name: Black
34-
runs-on: ubuntu-latest
35-
steps:
36-
- uses: actions/checkout@v4
37-
- uses: actions/setup-python@v5
38-
with:
39-
python-version: "3.13"
40-
cache: 'pip'
41-
42-
- name: Install dependencies
43-
run: |
44-
python -m pip install --upgrade pip
45-
pip install .
46-
pip install .[test]
47-
48-
- name: Black
49-
run: black --check .
50-
5133
ruff:
52-
name: Ruff
34+
name: Ruff Format
5335
runs-on: ubuntu-latest
5436
steps:
5537
- uses: actions/checkout@v4
@@ -64,28 +46,11 @@ jobs:
6446
pip install .
6547
pip install .[test]
6648
67-
- name: Ruff
68-
run: ruff check
49+
- name: Ruff Format Check
50+
run: ruff format --check .
6951

70-
pre-commit:
71-
name: Pre-Commit
72-
runs-on: ubuntu-latest
73-
steps:
74-
- uses: actions/checkout@v4
75-
- uses: actions/setup-python@v5
76-
with:
77-
python-version: "3.13"
78-
cache: 'pip'
79-
80-
- name: Install dependencies
81-
run: |
82-
python -m pip install --upgrade pip
83-
pip install .
84-
pip install .[test]
85-
pre-commit install
86-
87-
- name: Pre-Commit
88-
run: pre-commit run --all-files --show-diff-on-failure
52+
- name: Ruff Lint Check
53+
run: ruff check
8954

9055
security:
9156
name: Bandit Security
@@ -119,13 +84,16 @@ jobs:
11984
tests:
12085
name: Python ${{ matrix.python-version }} / ${{ matrix.db }} / Django ${{ matrix.django-version}}
12186
runs-on: ubuntu-latest
122-
# continue-on-error: ${{ matrix.django-version == '~=5.0' }}
87+
continue-on-error: ${{ matrix.django-version == '~=6.0' || matrix.python-version == '3.14' }}
12388
strategy:
124-
max-parallel: 4
89+
max-parallel: 6
12590
matrix:
12691
db: [ sqlite, mariadb ]
127-
django-version: [ "~=5.0" ]
128-
python-version: ["3.12", "3.13" ]
92+
django-version: [ "~=5.2", "~=6.0" ]
93+
python-version: ["3.12", "3.13", "3.14" ]
94+
exclude:
95+
- python-version: "3.12"
96+
django-version: "~=6.0"
12997

13098
services:
13199
mariadb:
@@ -216,8 +184,8 @@ jobs:
216184
release:
217185
name: Release
218186
runs-on: ubuntu-latest
219-
needs: ['outdated', 'black', 'pre-commit', 'security', 'tests', 'coverage']
220-
if: github.ref == 'refs/heads/master' # Only run on master
187+
needs: ['outdated', 'ruff', 'security', 'tests', 'coverage']
188+
if: always() && github.ref == 'refs/heads/master' && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
221189
permissions: write-all
222190
outputs:
223191
bumped: ${{ steps.release.outputs.bumped }}

.pre-commit-config.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ default_language_version:
22
python: python3.13
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v4.0.1
5+
rev: v5.0.0
66
hooks:
77
- id: check-added-large-files
88
args: [ '--maxkb=500' ]
@@ -20,11 +20,8 @@ repos:
2020
exclude: .idea/.*
2121
- id: check-json
2222
- repo: https://github.com/astral-sh/ruff-pre-commit
23-
# Ruff version.
24-
rev: v0.7.3
23+
rev: v0.14.8
2524
hooks:
26-
# Run the linter.
2725
- id: ruff
2826
args: [ --fix ]
29-
# Run the formatter.
3027
- id: ruff-format

pyproject.toml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "pivotal-django-states"
77
dynamic = ["version"]
88
description = "State machine for django models"
99
readme = "README.md"
10-
requires-python = ">=3.11"
10+
requires-python = ">=3.12"
1111
authors = [
1212
{ name = "Pivotal Energy Solutions", email = "steve@pivotal.energy" },
1313
]
@@ -19,18 +19,19 @@ classifiers = [
1919
"Development Status :: 5 - Production/Stable",
2020
"Environment :: Web Environment",
2121
"Framework :: Django",
22-
"Framework :: Django :: 5.0",
22+
"Framework :: Django :: 5.2",
23+
"Framework :: Django :: 6.0",
2324
"Intended Audience :: Developers",
2425
"License :: Other/Proprietary License",
2526
"Operating System :: OS Independent",
2627
"Programming Language :: Python",
27-
"Programming Language :: Python :: 3.11",
2828
"Programming Language :: Python :: 3.12",
2929
"Programming Language :: Python :: 3.13",
30+
"Programming Language :: Python :: 3.14",
3031
"Topic :: Utilities",
3132
]
3233
dependencies = [
33-
"Django>=5.0",
34+
"django>=5.2",
3435
"six"
3536
]
3637

@@ -72,13 +73,27 @@ include = [
7273

7374
[tool.black]
7475
line-length = 100
75-
target-version = ['py311']
76+
target-version = ['py312']
7677
include = '\.pyi?$'
7778
exclude = '(\.git|.venv|_build|build|dist|.*\/__pycache__\/)'
7879

7980
[tool.ruff]
81+
exclude = [".bzr", ".direnv", ".eggs", ".git", ".mypy_cache", ".nox", ".pytype", ".ruff_cache", ".svn", ".tox", ".venv", "__pypackages__", "_build", "build", "dist", "node_modules"]
8082
line-length = 100
81-
lint.ignore = ["F401"]
83+
indent-width = 4
84+
target-version = "py312"
85+
86+
[tool.ruff.lint]
87+
ignore = ["F401", "E402"]
88+
fixable = ["ALL"]
89+
unfixable = []
90+
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
91+
92+
[tool.ruff.format]
93+
quote-style = "double"
94+
indent-style = "space"
95+
skip-magic-trailing-comma = false
96+
line-ending = "auto"
8297

8398
[tool.bandit]
8499
targets = ['django_states']

0 commit comments

Comments
 (0)