Skip to content

Commit 5283b8f

Browse files
committed
Update Django and Python support
1 parent 730b2d4 commit 5283b8f

File tree

6 files changed

+25
-14
lines changed

6 files changed

+25
-14
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
default_language_version:
2-
python: python3.11
2+
python: python3.12
33

44
repos:
55
- repo: https://github.com/pre-commit/pre-commit-hooks
6-
rev: v4.6.0
6+
rev: v5.0.0
77
hooks:
88
- id: check-added-large-files
99
args: ["--maxkb=700"]
@@ -18,14 +18,14 @@ repos:
1818
- id: trailing-whitespace
1919

2020
- repo: https://github.com/asottile/pyupgrade
21-
rev: v3.16.0
21+
rev: v3.20.0
2222
hooks:
2323
- id: pyupgrade
2424
args:
2525
- "--py38-plus"
2626

2727
- repo: https://github.com/adamchainz/django-upgrade
28-
rev: 1.18.0
28+
rev: 1.25.0
2929
hooks:
3030
- id: django-upgrade
3131
args: [--target-version, "4.2"]
@@ -44,7 +44,7 @@ repos:
4444
- id: poetry-export
4545

4646
- repo: https://github.com/astral-sh/ruff-pre-commit
47-
rev: v0.4.8
47+
rev: v0.11.12
4848
hooks:
4949
- id: ruff-format
50-
- id: ruff
50+
- id: ruff-check

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
django-fsm adds simple declarative state management for django models.
1010

1111
> [!IMPORTANT]
12-
> Django FSM-2 started as a fork of [Django FSM](https://github.com/viewflow/django-fsm).
12+
> Django FSM-2 is a maintained fork of [Django FSM](https://github.com/viewflow/django-fsm).
1313
>
1414
> Big thanks to Mikhail Podgurskiy for starting this awesome project and maintaining it for so many years.
1515
>
16-
> Unfortunately, development has stalled for almost 2 years and it was officially announced there will be no new releases. [Viewflow](https://github.com/viewflow/viewflow) is presented as an alternative but the transition is not that easy.
16+
> Unfortunately, after 2 years without any releases, the project was brutally archived. [Viewflow](https://github.com/viewflow/viewflow) is presented as an alternative but the transition is not that easy.
1717
>
1818
> If what you need is just a simple state machine, tailor-made for Django, Django FSM-2 is the successor of Django FSM, with dependencies updates, typing (planned)
1919
@@ -39,6 +39,16 @@ Or, for the latest git version
3939
$ pip install -e git://github.com/django-commons/django-fsm-2.git#egg=django-fsm
4040
```
4141

42+
## Migration from django-fsm
43+
44+
django-fsm-2 is a drop-in replacement, it's actually the same project but from a different source.
45+
So all you need to do is to replace `django-fsm` dependency with `django-fsm-2`. And voila!
46+
47+
``` bash
48+
$ pip install django-fsm-2
49+
```
50+
51+
4252
## Usage
4353

4454
Add FSMState field to your model

django_fsm/management/commands/graph_transitions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def add_arguments(self, parser):
126126
"-o",
127127
action="store",
128128
dest="outputfile",
129-
help=("Render output file. Type of output dependent on file extensions. " "Use png or jpg to render graph to image."),
129+
help=("Render output file. Type of output dependent on file extensions. Use png or jpg to render graph to image."),
130130
)
131131
parser.add_argument(
132132
"--layout",

django_fsm/tests/test_protected_fields.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
from __future__ import annotations
22

3-
import unittest
4-
5-
import django
63
from django.db import models
74
from django.test import TestCase
85

@@ -40,7 +37,6 @@ def try_change():
4037
instance.save()
4138
self.assertEqual(instance.status, "published")
4239

43-
@unittest.skipIf(django.VERSION < (1, 8), "Django introduced refresh_from_db in 1.8")
4440
def test_refresh_from_db(self):
4541
instance = RefreshableModel()
4642
instance.save()

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@ classifiers = [
2020
"Framework :: Django :: 4.2",
2121
"Framework :: Django :: 5.0",
2222
"Framework :: Django :: 5.1",
23+
"Framework :: Django :: 5.2",
2324
'Programming Language :: Python',
2425
'Programming Language :: Python :: 3',
2526
'Programming Language :: Python :: 3.8',
2627
'Programming Language :: Python :: 3.9',
2728
'Programming Language :: Python :: 3.10',
2829
'Programming Language :: Python :: 3.11',
2930
'Programming Language :: Python :: 3.12',
31+
'Programming Language :: Python :: 3.13',
3032
'Topic :: Software Development :: Libraries :: Python Modules',
3133
]
3234
packages = [{ include = "django_fsm" }]

tox.ini

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ envlist =
33
py{38,39,310,311}-dj42
44
py{310,311,312}-dj50
55
py{310,311,312}-dj51
6+
py{310,311,312,313}-dj52
67
skipsdist = True
78

89
[testenv]
910
deps =
1011
dj42: Django==4.2
1112
dj50: Django==5.0
12-
dj51: Django==5.1b1
13+
dj51: Django==5.1
14+
dj52: Django==5.2
1315

1416
django-guardian
1517
graphviz
@@ -28,3 +30,4 @@ python =
2830
3.10: py310
2931
3.11: py311
3032
3.12: py312
33+
3.13: py313

0 commit comments

Comments
 (0)