Skip to content

Commit 365f8de

Browse files
committed
feat: add Python 3.14 support and make it the default
- Add Python 3.14 to CI test matrix and classifiers - Update mypy python_version and ruff target-version to 3.14 - Update release workflow and ReadTheDocs to Python 3.14 - Remove stale Python 3.7 pydot step from CI - Add UP037 and UP042 to ruff ignore (require future annotations / 3.11+) - Remove stale UP038 ignore (rule removed from ruff) - Add match parameter to pytest.warns (PT030) - Upgrade ruff 0.8.1 -> 0.15.0, mypy 1.4.1 -> 1.14.1, watchfiles 0.24.0 -> 1.1.1
1 parent 8c518fc commit 365f8de

7 files changed

Lines changed: 218 additions & 130 deletions

File tree

.github/workflows/python-package.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
18+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
1919

2020
steps:
2121
- uses: actions/checkout@v4
@@ -33,15 +33,11 @@ jobs:
3333
cache-suffix: "python${{ matrix.python-version }}"
3434
- name: Install the project
3535
run: uv sync --all-extras --dev
36-
- name: Install old pydot for 3.7 only
37-
if: matrix.python-version == 3.7
38-
run: |
39-
uv pip install pydot==2.0.0
4036
#----------------------------------------------
4137
# run ruff
4238
#----------------------------------------------
4339
- name: Linter with ruff
44-
if: matrix.python-version == 3.13
40+
if: matrix.python-version == 3.14
4541
run: |
4642
uv run ruff check .
4743
uv run ruff format --check .
@@ -57,7 +53,7 @@ jobs:
5753
#----------------------------------------------
5854
- name: Upload coverage to Codecov
5955
uses: codecov/codecov-action@v4
60-
if: matrix.python-version == 3.13
56+
if: matrix.python-version == 3.14
6157
with:
6258
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
6359
directory: .

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Setup Python
1919
uses: actions/setup-python@v5
2020
with:
21-
python-version: '3.13'
21+
python-version: '3.14'
2222

2323
- name: Setup Graphviz
2424
uses: ts-graphviz/setup-graphviz@v2

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ version: 2
88
build:
99
os: "ubuntu-22.04"
1010
tools:
11-
python: "3.12"
11+
python: "3.14"
1212
apt_packages:
1313
- graphviz
1414
jobs:

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ uv run mypy statemachine/ tests/
7272

7373
## Code style
7474

75-
- **Formatter/Linter:** ruff (line length 99, target Python 3.13)
75+
- **Formatter/Linter:** ruff (line length 99, target Python 3.14)
7676
- **Rules:** pycodestyle, pyflakes, isort, pyupgrade, flake8-comprehensions, flake8-bugbear, flake8-pytest-style
7777
- **Imports:** single-line, sorted by isort
7878
- **Docstrings:** Google convention

pyproject.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ classifiers = [
1717
"Programming Language :: Python :: 3.11",
1818
"Programming Language :: Python :: 3.12",
1919
"Programming Language :: Python :: 3.13",
20+
"Programming Language :: Python :: 3.14",
2021
"Programming Language :: Python :: 3.7",
2122
"Programming Language :: Python :: 3.8",
2223
"Programming Language :: Python :: 3.9",
@@ -113,7 +114,7 @@ directory = "tmp/htmlcov"
113114
show_contexts = true
114115

115116
[tool.mypy]
116-
python_version = "3.13"
117+
python_version = "3.14"
117118
warn_return_any = true
118119
warn_unused_configs = true
119120
disable_error_code = "annotation-unchecked"
@@ -127,7 +128,7 @@ ignore_missing_imports = true
127128
src = ["statemachine"]
128129

129130
line-length = 99
130-
target-version = "py313"
131+
target-version = "py314"
131132

132133
# Exclude a variety of commonly ignored directories.
133134
exclude = [
@@ -166,7 +167,8 @@ select = [
166167
ignore = [
167168
"UP006", # `use-pep585-annotation` Requires Python3.9+
168169
"UP035", # `use-pep585-annotation` Requires Python3.9+
169-
"UP038", # `use-pep585-annotation` Requires Python3.9+
170+
"UP037", # `remove-quotes-from-type-annotation` Not safe without `from __future__ import annotations`
171+
"UP042", # `use-str-enum` Requires Python3.11+
170172
]
171173

172174
# Allow unused variables when underscore-prefixed.

tests/test_registry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class CampaignMachine(StateMachine):
2828
assert "CampaignMachine" in registry._REGISTRY
2929
assert registry.get_machine_cls("tests.test_registry.CampaignMachine") == CampaignMachine
3030

31-
with pytest.warns(DeprecationWarning):
31+
with pytest.warns(DeprecationWarning, match="fully qualified names"):
3232
assert registry.get_machine_cls("CampaignMachine") == CampaignMachine
3333

3434

0 commit comments

Comments
 (0)