Skip to content

Commit 0ffafec

Browse files
committed
Update Django and Python support
1 parent 730b2d4 commit 0ffafec

File tree

10 files changed

+69
-23
lines changed

10 files changed

+69
-23
lines changed

.github/workflows/coverage.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
virtualenvs-create: true
2121
virtualenvs-in-project: true
2222

23-
- name: Set up Python 3.11
23+
- name: Set up Python 3.12
2424
uses: actions/setup-python@v5
2525
with:
26-
python-version: "3.11"
26+
python-version: "3.12"
2727
cache: poetry
2828

2929
- name: Install requirements
@@ -34,3 +34,5 @@ jobs:
3434

3535
- name: Upload coverage reports to Codecov
3636
uses: codecov/codecov-action@v5
37+
with:
38+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ jobs:
1414
- uses: actions/checkout@v4
1515
- uses: actions/setup-python@v5
1616
with:
17-
python-version: '3.11'
17+
python-version: '3.12'
1818
- uses: pre-commit/[email protected]

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111

1212
strategy:
1313
matrix:
14-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
14+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
1515

1616
steps:
1717
- uses: actions/checkout@v4

.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()

poetry.lock

Lines changed: 38 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)