python-statemachine 2.3.4__tar.gz → 2.3.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. {python_statemachine-2.3.4 → python_statemachine-2.3.6}/PKG-INFO +3 -1
  2. {python_statemachine-2.3.4 → python_statemachine-2.3.6}/pyproject.toml +7 -7
  3. {python_statemachine-2.3.4 → python_statemachine-2.3.6}/statemachine/__init__.py +1 -1
  4. {python_statemachine-2.3.4 → python_statemachine-2.3.6}/statemachine/contrib/diagram.py +6 -6
  5. {python_statemachine-2.3.4 → python_statemachine-2.3.6}/statemachine/engines/async_.py +1 -0
  6. {python_statemachine-2.3.4 → python_statemachine-2.3.6}/statemachine/engines/sync.py +1 -0
  7. python_statemachine-2.3.6/statemachine/py.typed +0 -0
  8. {python_statemachine-2.3.4 → python_statemachine-2.3.6}/statemachine/statemachine.py +5 -4
  9. {python_statemachine-2.3.4 → python_statemachine-2.3.6}/LICENSE +0 -0
  10. {python_statemachine-2.3.4 → python_statemachine-2.3.6}/README.md +0 -0
  11. {python_statemachine-2.3.4 → python_statemachine-2.3.6}/statemachine/callbacks.py +0 -0
  12. {python_statemachine-2.3.4 → python_statemachine-2.3.6}/statemachine/contrib/__init__.py +0 -0
  13. {python_statemachine-2.3.4 → python_statemachine-2.3.6}/statemachine/dispatcher.py +0 -0
  14. {python_statemachine-2.3.4 → python_statemachine-2.3.6}/statemachine/engines/__init__.py +0 -0
  15. {python_statemachine-2.3.4 → python_statemachine-2.3.6}/statemachine/event.py +0 -0
  16. {python_statemachine-2.3.4 → python_statemachine-2.3.6}/statemachine/event_data.py +0 -0
  17. {python_statemachine-2.3.4 → python_statemachine-2.3.6}/statemachine/events.py +0 -0
  18. {python_statemachine-2.3.4 → python_statemachine-2.3.6}/statemachine/exceptions.py +0 -0
  19. {python_statemachine-2.3.4 → python_statemachine-2.3.6}/statemachine/factory.py +0 -0
  20. {python_statemachine-2.3.4 → python_statemachine-2.3.6}/statemachine/graph.py +0 -0
  21. {python_statemachine-2.3.4 → python_statemachine-2.3.6}/statemachine/i18n.py +0 -0
  22. {python_statemachine-2.3.4 → python_statemachine-2.3.6}/statemachine/locale/en/LC_MESSAGES/statemachine.po +0 -0
  23. {python_statemachine-2.3.4 → python_statemachine-2.3.6}/statemachine/locale/pt_BR/LC_MESSAGES/statemachine.po +0 -0
  24. {python_statemachine-2.3.4 → python_statemachine-2.3.6}/statemachine/mixins.py +0 -0
  25. {python_statemachine-2.3.4 → python_statemachine-2.3.6}/statemachine/model.py +0 -0
  26. {python_statemachine-2.3.4 → python_statemachine-2.3.6}/statemachine/registry.py +0 -0
  27. {python_statemachine-2.3.4 → python_statemachine-2.3.6}/statemachine/signature.py +0 -0
  28. {python_statemachine-2.3.4 → python_statemachine-2.3.6}/statemachine/state.py +0 -0
  29. {python_statemachine-2.3.4 → python_statemachine-2.3.6}/statemachine/states.py +0 -0
  30. {python_statemachine-2.3.4 → python_statemachine-2.3.6}/statemachine/transition.py +0 -0
  31. {python_statemachine-2.3.4 → python_statemachine-2.3.6}/statemachine/transition_list.py +0 -0
  32. {python_statemachine-2.3.4 → python_statemachine-2.3.6}/statemachine/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-statemachine
3
- Version: 2.3.4
3
+ Version: 2.3.6
4
4
  Summary: Python Finite State Machines made easy.
5
5
  Home-page: https://github.com/fgmacedo/python-statemachine
6
6
  License: MIT
@@ -20,8 +20,10 @@ Classifier: Programming Language :: Python :: 3.9
20
20
  Classifier: Programming Language :: Python :: 3.10
21
21
  Classifier: Programming Language :: Python :: 3.11
22
22
  Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
23
24
  Classifier: Topic :: Software Development :: Libraries
24
25
  Provides-Extra: diagrams
26
+ Requires-Dist: pydot (>=2.0.0) ; extra == "diagrams"
25
27
  Description-Content-Type: text/markdown
26
28
 
27
29
  # Python StateMachine
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "python-statemachine"
3
- version = "2.3.4"
3
+ version = "2.3.6"
4
4
  description = "Python Finite State Machines made easy."
5
5
  authors = ["Fernando Macedo <fgmacedo@gmail.com>"]
6
6
  maintainers = [
@@ -27,19 +27,20 @@ classifiers = [
27
27
  "Programming Language :: Python :: 3.10",
28
28
  "Programming Language :: Python :: 3.11",
29
29
  "Programming Language :: Python :: 3.12",
30
+ "Programming Language :: Python :: 3.13",
30
31
  "Topic :: Software Development :: Libraries",
31
32
  "Framework :: AsyncIO",
32
33
  "Intended Audience :: Developers",
33
34
  ]
34
35
 
35
- [tool.poetry.extras]
36
- diagrams = ["pydot"]
37
-
38
36
  [tool.poetry.dependencies]
39
37
  python = ">=3.7"
38
+ pydot = { version = ">=2.0.0", optional = true }
39
+
40
+ [tool.poetry.extras]
41
+ diagrams = ["pydot"]
40
42
 
41
43
  [tool.poetry.group.dev.dependencies]
42
- pydot = "^2.0.0"
43
44
  ruff = "^0.4.8"
44
45
  pre-commit = "*"
45
46
  mypy = "*"
@@ -49,10 +50,9 @@ pytest = "*"
49
50
  pytest-cov = "*"
50
51
  pytest-sugar = "^1.0.0"
51
52
  pytest-mock = "^3.10.0"
52
- pytest-profiling = "^1.7.0"
53
53
  pytest-benchmark = "^4.0.0"
54
54
  pytest-asyncio = "*"
55
- django = { version = "^5.0.3", python = ">3.10" }
55
+ django = { version = "^5.0.8", python = ">3.10" }
56
56
  pytest-django = { version = "^4.8.0", python = ">3.8" }
57
57
 
58
58
  [tool.poetry.group.docs.dependencies]
@@ -3,6 +3,6 @@ from .statemachine import StateMachine
3
3
 
4
4
  __author__ = """Fernando Macedo"""
5
5
  __email__ = "fgmacedo@gmail.com"
6
- __version__ = "2.3.4"
6
+ __version__ = "2.3.6"
7
7
 
8
8
  __all__ = ["StateMachine", "State"]
@@ -18,16 +18,16 @@ class DotGraphMachine:
18
18
  font_name = "Arial"
19
19
  """Graph font face name"""
20
20
 
21
- state_font_size = "10pt"
22
- """State font size"""
21
+ state_font_size = "10"
22
+ """State font size in points"""
23
23
 
24
24
  state_active_penwidth = 2
25
25
  """Active state external line width"""
26
26
 
27
27
  state_active_fillcolor = "turquoise"
28
28
 
29
- transition_font_size = "9pt"
30
- """Transition font size"""
29
+ transition_font_size = "9"
30
+ """Transition font size in points"""
31
31
 
32
32
  def __init__(self, machine):
33
33
  self.machine = machine
@@ -48,7 +48,7 @@ class DotGraphMachine:
48
48
  "i",
49
49
  shape="circle",
50
50
  style="filled",
51
- fontsize="1pt",
51
+ fontsize="1",
52
52
  fixedsize="true",
53
53
  width=0.2,
54
54
  height=0.2,
@@ -167,7 +167,7 @@ def quickchart_write_svg(sm: StateMachine, path: str):
167
167
  >>> print(sm._graph().to_string())
168
168
  digraph list {
169
169
  fontname=Arial;
170
- fontsize="10pt";
170
+ fontsize=10;
171
171
  label=OrderControl;
172
172
  rankdir=LR;
173
173
  ...
@@ -15,6 +15,7 @@ if TYPE_CHECKING:
15
15
 
16
16
  class AsyncEngine:
17
17
  def __init__(self, sm: "StateMachine", rtc: bool = True):
18
+ sm._engine = self
18
19
  self.sm = proxy(sm)
19
20
  self._sentinel = object()
20
21
  if not rtc:
@@ -13,6 +13,7 @@ if TYPE_CHECKING:
13
13
 
14
14
  class SyncEngine:
15
15
  def __init__(self, sm: "StateMachine", rtc: bool = True):
16
+ sm._engine = self
16
17
  self.sm = proxy(sm)
17
18
  self._sentinel = object()
18
19
  self._rtc = rtc
File without changes
@@ -105,13 +105,14 @@ class StateMachine(metaclass=StateMachineMetaclass):
105
105
  )
106
106
  self._put_nonblocking(trigger_data)
107
107
 
108
- self._engine = self._get_engine(rtc)
108
+ self._engine: AsyncEngine | SyncEngine | None = None
109
+ self._select_engine(rtc)
109
110
 
110
- def _get_engine(self, rtc: bool):
111
+ def _select_engine(self, rtc: bool):
111
112
  if self._callbacks_registry.has_async_callbacks:
112
- return AsyncEngine(self, rtc=rtc)
113
+ AsyncEngine(self, rtc=rtc)
113
114
  else:
114
- return SyncEngine(self, rtc=rtc)
115
+ SyncEngine(self, rtc=rtc)
115
116
 
116
117
  def activate_initial_state(self):
117
118
  result = self._engine.activate_initial_state()