Visitar URL original
chore(deps): upgrade all direct dependencies (#659) · fgmacedo/python-statemachine@525bcdd · GitHub
Skip to content

Commit 525bcdd

Browse files
authored
chore(deps): upgrade all direct dependencies (#659)
1 parent 45d6ab1 commit 525bcdd

21 files changed

Lines changed: 1418 additions & 991 deletions

‎.github/workflows/pages.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
name: github-pages
3232
url: ${{ steps.deployment.outputs.page_url }}
3333
steps:
34-
- uses: actions/checkout@v5
34+
- uses: actions/checkout@v7
3535
- name: Assemble site
3636
run: |
3737
mkdir -p _site/schemas/statechart
@@ -44,8 +44,8 @@ jobs:
4444
<p>See the <a href="schemas/statechart/v1.json">statechart JSON Schema</a> or the
4545
<a href="https://python-statemachine.readthedocs.io/">documentation</a>.</p>
4646
HTML
47-
- uses: actions/upload-pages-artifact@v3
47+
- uses: actions/upload-pages-artifact@v5
4848
with:
4949
path: _site
5050
- id: deployment
51-
uses: actions/deploy-pages@v4
51+
uses: actions/deploy-pages@v5

‎.github/workflows/python-package.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ jobs:
2121
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
2222

2323
steps:
24-
- uses: actions/checkout@v5
24+
- uses: actions/checkout@v7
2525
- run: git fetch origin develop
2626
- name: Set up Python ${{ matrix.python-version }}
27-
uses: actions/setup-python@v6
27+
uses: actions/setup-python@v7
2828
with:
2929
python-version: ${{ matrix.python-version }}
3030
- name: Setup Graphviz
3131
uses: ts-graphviz/setup-graphviz@v2
3232
- name: Install uv
33-
uses: astral-sh/setup-uv@v8.1.0
33+
uses: astral-sh/setup-uv@v10.1.0
3434
with:
3535
enable-cache: true
3636
cache-suffix: "python${{ matrix.python-version }}"
@@ -55,7 +55,7 @@ jobs:
5555
# upload coverage
5656
#----------------------------------------------
5757
- name: Upload coverage to Codecov
58-
uses: codecov/codecov-action@v6
58+
uses: codecov/codecov-action@v7
5959
if: matrix.python-version == 3.14
6060
with:
6161
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos

‎.github/workflows/release.yml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ jobs:
1111
permissions:
1212
id-token: write
1313
steps:
14-
- uses: actions/checkout@v5
14+
- uses: actions/checkout@v7
1515

1616
- run: git fetch origin develop
1717

1818
- name: Setup Python
19-
uses: actions/setup-python@v6
19+
uses: actions/setup-python@v7
2020
with:
2121
python-version: '3.14'
2222

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

2626
- name: Install uv
27-
uses: astral-sh/setup-uv@v8.1.0
27+
uses: astral-sh/setup-uv@v10.1.0
2828
with:
2929
enable-cache: true
3030

@@ -40,7 +40,7 @@ jobs:
4040
uv build
4141
4242
- name: Upload dists
43-
uses: actions/upload-artifact@v4
43+
uses: actions/upload-artifact@v7
4444
with:
4545
name: release-dists
4646
path: dist/
@@ -59,7 +59,7 @@ jobs:
5959

6060
steps:
6161
- name: Retrieve release distributions
62-
uses: actions/download-artifact@v4
62+
uses: actions/download-artifact@v8
6363
with:
6464
name: release-dists
6565
path: dist/

‎.pre-commit-config.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ repos:
99
exclude: docs/auto_examples
1010
- repo: https://github.com/astral-sh/ruff-pre-commit
1111
# Ruff version.
12-
rev: v0.15.17
12+
rev: v0.16.7
1313
hooks:
1414
# Run the linter.
1515
- id: ruff

‎docs/diagram.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ Sphinx directive):
214214
```python
215215
from statemachine.contrib.diagram import formatter
216216

217+
217218
@formatter.register_format("plantuml", "puml")
218219
def _render_plantuml(machine_or_class):
219220
# your PlantUML renderer here
@@ -525,6 +526,7 @@ class CustomDiagram(DotGraphMachine):
525526
graph_rankdir = "TB"
526527
state_active_fillcolor = "lightyellow"
527528

529+
528530
sm = OrderControl()
529531
sm.receive_payment(10)
530532

‎docs/guards.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ listeners. They can point to properties, attributes, or methods:
254254
**Parentheses** control evaluation order:
255255

256256
```python
257-
cond="(is_admin or is_moderator) and not is_banned"
257+
cond = "(is_admin or is_moderator) and not is_banned"
258258
```
259259

260260
#### Expression examples

‎docs/how-to/coming_from_state_pattern.md‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,13 @@ class OrderState(ABC):
2828
"""Abstract base for all order states."""
2929

3030
@abstractmethod
31-
def confirm(self, order):
32-
...
31+
def confirm(self, order): ...
3332

3433
@abstractmethod
35-
def ship(self, order):
36-
...
34+
def ship(self, order): ...
3735

3836
@abstractmethod
39-
def deliver(self, order):
40-
...
37+
def deliver(self, order): ...
4138

4239

4340
class DraftState(OrderState):

‎docs/how-to/coming_from_transitions.md‎

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ that reads SCXML, JSON and YAML *documents* straight into a `StateChart`:
233233
```python
234234
from statemachine.io import load
235235

236-
Machine = load("traffic_light.scxml") # or .json / .yaml; format detected from the extension
236+
Machine = load("traffic_light.scxml") # or .json / .yaml; format detected from the extension
237237
```
238238

239239
Expressions in the document (guards, datamodel) are evaluated by a restricted allowlist —
@@ -306,8 +306,8 @@ True
306306
In *transitions*, events are called as methods on the model:
307307

308308
```python
309-
machine.produce() # triggers the "produce" event
310-
machine.deliver() # triggers the "deliver" event
309+
machine.produce() # triggers the "produce" event
310+
machine.deliver() # triggers the "deliver" event
311311
```
312312

313313
python-statemachine supports both styles:
@@ -342,13 +342,15 @@ Callbacks are specified as strings (method names) or callables:
342342
```python
343343
machine = Machine(
344344
states=states,
345-
transitions=[{
346-
"trigger": "produce",
347-
"source": "draft",
348-
"dest": "producing",
349-
"before": "validate_job",
350-
"after": "notify_team",
351-
}],
345+
transitions=[
346+
{
347+
"trigger": "produce",
348+
"source": "draft",
349+
"dest": "producing",
350+
"before": "validate_job",
351+
"after": "notify_team",
352+
}
353+
],
352354
initial="draft",
353355
)
354356
```
@@ -454,7 +456,9 @@ In *transitions*:
454456

455457
```python
456458
machine.add_transition(
457-
"produce", "draft", "producing",
459+
"produce",
460+
"draft",
461+
"producing",
458462
conditions=["is_valid", "has_resources"],
459463
unless=["is_locked"],
460464
)
@@ -588,10 +592,12 @@ See {ref}`invoke` for full documentation.
588592
```python
589593
from transitions.extensions import AsyncMachine
590594

595+
591596
class AsyncModel:
592597
async def on_enter_producing(self):
593598
await some_async_operation()
594599

600+
595601
machine = AsyncMachine(model=AsyncModel(), states=states, initial="draft")
596602
await machine.produce()
597603
```
@@ -752,6 +758,7 @@ No class swapping, no feature matrices to consult — just `StateChart`.
752758
class MyModel:
753759
pass
754760

761+
755762
model = MyModel()
756763
machine = Machine(model=model, states=states, transitions=transitions, initial="draft")
757764
model.produce() # events are added to the model

‎docs/integrations.md‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,11 @@ from statemachine import State
120120

121121
class CampaignMachine(StateChart):
122122
"A workflow machine"
123-
draft = State('Draft', initial=True, value=1)
124-
producing = State('Being produced', value=2)
125-
closed = State('Closed', value=3)
126-
cancelled = State('Cancelled', value=4)
123+
124+
draft = State("Draft", initial=True, value=1)
125+
producing = State("Being produced", value=2)
126+
closed = State("Closed", value=3)
127+
cancelled = State("Cancelled", value=4)
127128

128129
add_job = draft.to.itself() | producing.to.itself()
129130
produce = draft.to(producing)
@@ -142,9 +143,9 @@ from statemachine.mixins import MachineMixin
142143

143144

144145
class Campaign(models.Model, MachineMixin):
145-
state_machine_name = 'campaign.statemachines.CampaignMachine'
146-
state_machine_attr = 'sm'
147-
state_field_name = 'step'
146+
state_machine_name = "campaign.statemachines.CampaignMachine"
147+
state_machine_attr = "sm"
148+
state_field_name = "step"
148149

149150
name = models.CharField(max_length=30)
150151
step = models.IntegerField()

‎docs/releases/1.0.1.md‎

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ Transitions now support `cond` and `unless` parameters, to restrict
2727
the execution.
2828

2929
```python
30-
class ApprovalMachine(StateMachine):
31-
"A workflow machine"
32-
requested = State("Requested", initial=True)
33-
accepted = State("Accepted")
34-
rejected = State("Rejected")
35-
completed = State("Completed")
30+
class ApprovalMachine(StateMachine):
31+
"A workflow machine"
32+
33+
requested = State("Requested", initial=True)
34+
accepted = State("Accepted")
35+
rejected = State("Rejected")
36+
completed = State("Completed")
3637

37-
validate = requested.to(accepted, cond="is_ok") | requested.to(rejected)
38+
validate = requested.to(accepted, cond="is_ok") | requested.to(rejected)
3839
```
3940

4041
```{seealso}
@@ -114,9 +115,10 @@ So, the previous code (not valid anymore):
114115
```py
115116
class ApprovalMachine(StateMachine):
116117
"A workflow machine"
117-
requested = State('Requested', initial=True)
118-
accepted = State('Accepted')
119-
rejected = State('Rejected')
118+
119+
requested = State("Requested", initial=True)
120+
accepted = State("Accepted")
121+
rejected = State("Rejected")
120122

121123
validate = requested.to(accepted, rejected)
122124

@@ -133,6 +135,7 @@ Should be rewritten to use {ref}`guards`, like this:
133135
``` py
134136
class ApprovalMachine(StateMachine):
135137
"A workflow machine"
138+
136139
requested = State("Requested", initial=True)
137140
accepted = State("Accepted")
138141
rejected = State("Rejected")
@@ -168,14 +171,16 @@ This was the previous behavior, you only got an error when trying to instantiate
168171
```py
169172
class CampaignMachine(StateMachine):
170173
"A workflow machine"
171-
draft = State('Draft', initial=True)
172-
producing = State('Being produced')
173-
closed = State('Closed', initial=True) # Should raise an Exception when instantiated
174+
175+
draft = State("Draft", initial=True)
176+
producing = State("Being produced")
177+
closed = State("Closed", initial=True) # Should raise an Exception when instantiated
174178

175179
add_job = draft.to(draft) | producing.to(producing)
176180
produce = draft.to(producing)
177181
deliver = producing.to(closed)
178182

183+
179184
with pytest.raises(exceptions.InvalidDefinition):
180185
CampaignMachine()
181186
```
@@ -187,6 +192,7 @@ with pytest.raises(exceptions.InvalidDefinition):
187192

188193
class CampaignMachine(StateMachine):
189194
"A workflow machine"
195+
190196
draft = State("Draft", initial=True)
191197
producing = State("Being produced")
192198
closed = State(

0 commit comments

Comments
 (0)