python-statemachine 2.3.6__tar.gz → 2.5.0__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 (176) hide show
  1. python_statemachine-2.5.0/.git-blame-ignore-revs +4 -0
  2. python_statemachine-2.5.0/.github/FUNDING.yml +1 -0
  3. python_statemachine-2.5.0/.github/ISSUE_TEMPLATE.md +15 -0
  4. python_statemachine-2.5.0/.github/workflows/python-package.yml +68 -0
  5. python_statemachine-2.5.0/.github/workflows/release.yml +68 -0
  6. python_statemachine-2.5.0/.gitignore +81 -0
  7. python_statemachine-2.5.0/.pre-commit-config.yaml +33 -0
  8. python_statemachine-2.5.0/.readthedocs.yaml +23 -0
  9. {python_statemachine-2.3.6 → python_statemachine-2.5.0}/PKG-INFO +22 -23
  10. {python_statemachine-2.3.6 → python_statemachine-2.5.0}/README.md +11 -11
  11. python_statemachine-2.5.0/conftest.py +33 -0
  12. python_statemachine-2.5.0/contributing.md +1 -0
  13. python_statemachine-2.5.0/docs/_static/custom_machine.css +59 -0
  14. python_statemachine-2.5.0/docs/actions.md +463 -0
  15. python_statemachine-2.5.0/docs/api.md +81 -0
  16. python_statemachine-2.5.0/docs/async.md +186 -0
  17. python_statemachine-2.5.0/docs/authors.md +18 -0
  18. python_statemachine-2.5.0/docs/conf.py +299 -0
  19. python_statemachine-2.5.0/docs/contributing.md +161 -0
  20. python_statemachine-2.5.0/docs/diagram.md +140 -0
  21. python_statemachine-2.5.0/docs/guards.md +174 -0
  22. python_statemachine-2.5.0/docs/images/_oc_machine_processing.svg +90 -0
  23. python_statemachine-2.5.0/docs/images/lab_approval_machine_accepted.png +0 -0
  24. python_statemachine-2.5.0/docs/images/oc_machine_processing.svg +90 -0
  25. python_statemachine-2.5.0/docs/images/order_control_machine_initial.png +0 -0
  26. python_statemachine-2.5.0/docs/images/order_control_machine_processing.png +0 -0
  27. python_statemachine-2.5.0/docs/images/python-statemachine.png +0 -0
  28. python_statemachine-2.5.0/docs/images/readme_trafficlightmachine.png +0 -0
  29. python_statemachine-2.5.0/docs/images/test_state_machine_internal.png +0 -0
  30. python_statemachine-2.5.0/docs/images/traffic_light_machine.png +0 -0
  31. python_statemachine-2.5.0/docs/index.md +33 -0
  32. python_statemachine-2.5.0/docs/installation.md +54 -0
  33. python_statemachine-2.5.0/docs/integrations.md +71 -0
  34. python_statemachine-2.5.0/docs/listeners.md +105 -0
  35. python_statemachine-2.5.0/docs/mixins.md +93 -0
  36. python_statemachine-2.5.0/docs/models.md +27 -0
  37. python_statemachine-2.5.0/docs/processing_model.md +138 -0
  38. python_statemachine-2.5.0/docs/readme.md +2 -0
  39. python_statemachine-2.5.0/docs/releases/0.1.0.md +5 -0
  40. python_statemachine-2.5.0/docs/releases/0.2.0.md +8 -0
  41. python_statemachine-2.5.0/docs/releases/0.3.0.md +7 -0
  42. python_statemachine-2.5.0/docs/releases/0.4.2.md +12 -0
  43. python_statemachine-2.5.0/docs/releases/0.5.0.md +7 -0
  44. python_statemachine-2.5.0/docs/releases/0.5.1.md +7 -0
  45. python_statemachine-2.5.0/docs/releases/0.6.0.md +7 -0
  46. python_statemachine-2.5.0/docs/releases/0.6.1.md +6 -0
  47. python_statemachine-2.5.0/docs/releases/0.6.2.md +6 -0
  48. python_statemachine-2.5.0/docs/releases/0.7.0.md +6 -0
  49. python_statemachine-2.5.0/docs/releases/0.7.1.md +6 -0
  50. python_statemachine-2.5.0/docs/releases/0.8.0.md +21 -0
  51. python_statemachine-2.5.0/docs/releases/0.9.0.md +65 -0
  52. python_statemachine-2.5.0/docs/releases/1.0.0.md +6 -0
  53. python_statemachine-2.5.0/docs/releases/1.0.1.md +229 -0
  54. python_statemachine-2.5.0/docs/releases/1.0.2.md +14 -0
  55. python_statemachine-2.5.0/docs/releases/1.0.3.md +14 -0
  56. python_statemachine-2.5.0/docs/releases/2.0.0.md +366 -0
  57. python_statemachine-2.5.0/docs/releases/2.1.0.md +43 -0
  58. python_statemachine-2.5.0/docs/releases/2.1.1.md +10 -0
  59. python_statemachine-2.5.0/docs/releases/2.1.2.md +20 -0
  60. python_statemachine-2.5.0/docs/releases/2.2.0.md +71 -0
  61. python_statemachine-2.5.0/docs/releases/2.3.0.md +49 -0
  62. python_statemachine-2.5.0/docs/releases/2.3.1.md +8 -0
  63. python_statemachine-2.5.0/docs/releases/2.3.2.md +95 -0
  64. python_statemachine-2.5.0/docs/releases/2.3.3.md +20 -0
  65. python_statemachine-2.5.0/docs/releases/2.3.4.md +8 -0
  66. python_statemachine-2.5.0/docs/releases/2.3.5.md +12 -0
  67. python_statemachine-2.5.0/docs/releases/2.3.6.md +9 -0
  68. python_statemachine-2.5.0/docs/releases/2.4.0.md +89 -0
  69. python_statemachine-2.5.0/docs/releases/2.5.0.md +188 -0
  70. python_statemachine-2.5.0/docs/releases/index.md +69 -0
  71. python_statemachine-2.5.0/docs/states.md +166 -0
  72. python_statemachine-2.5.0/docs/transitions.md +375 -0
  73. {python_statemachine-2.3.6 → python_statemachine-2.5.0}/pyproject.toml +103 -107
  74. {python_statemachine-2.3.6 → python_statemachine-2.5.0}/statemachine/__init__.py +3 -2
  75. {python_statemachine-2.3.6 → python_statemachine-2.5.0}/statemachine/callbacks.py +82 -67
  76. {python_statemachine-2.3.6 → python_statemachine-2.5.0}/statemachine/contrib/diagram.py +4 -8
  77. python_statemachine-2.5.0/statemachine/dispatcher.py +232 -0
  78. {python_statemachine-2.3.6 → python_statemachine-2.5.0}/statemachine/engines/async_.py +27 -34
  79. python_statemachine-2.5.0/statemachine/engines/base.py +40 -0
  80. {python_statemachine-2.3.6 → python_statemachine-2.5.0}/statemachine/engines/sync.py +29 -37
  81. python_statemachine-2.5.0/statemachine/event.py +148 -0
  82. {python_statemachine-2.3.6 → python_statemachine-2.5.0}/statemachine/event_data.py +2 -1
  83. python_statemachine-2.5.0/statemachine/events.py +39 -0
  84. {python_statemachine-2.3.6 → python_statemachine-2.5.0}/statemachine/exceptions.py +3 -2
  85. {python_statemachine-2.3.6 → python_statemachine-2.5.0}/statemachine/factory.py +53 -22
  86. {python_statemachine-2.3.6 → python_statemachine-2.5.0}/statemachine/locale/en/LC_MESSAGES/statemachine.po +27 -15
  87. python_statemachine-2.5.0/statemachine/locale/hi_IN/LC_MESSAGES/statemachine.po +93 -0
  88. python_statemachine-2.5.0/statemachine/locale/pt_BR/LC_MESSAGES/statemachine.po +93 -0
  89. python_statemachine-2.5.0/statemachine/locale/zh_CN/LC_MESSAGES/statemachine.po +93 -0
  90. {python_statemachine-2.3.6 → python_statemachine-2.5.0}/statemachine/signature.py +7 -26
  91. python_statemachine-2.5.0/statemachine/spec_parser.py +150 -0
  92. {python_statemachine-2.3.6 → python_statemachine-2.5.0}/statemachine/state.py +66 -27
  93. {python_statemachine-2.3.6 → python_statemachine-2.5.0}/statemachine/statemachine.py +52 -73
  94. {python_statemachine-2.3.6 → python_statemachine-2.5.0}/statemachine/states.py +2 -2
  95. {python_statemachine-2.3.6 → python_statemachine-2.5.0}/statemachine/transition.py +23 -4
  96. {python_statemachine-2.3.6 → python_statemachine-2.5.0}/statemachine/transition_list.py +17 -79
  97. python_statemachine-2.5.0/statemachine/transition_mixin.py +82 -0
  98. python_statemachine-2.5.0/tests/__init__.py +0 -0
  99. python_statemachine-2.5.0/tests/conftest.py +213 -0
  100. python_statemachine-2.5.0/tests/django_project/app.py +11 -0
  101. python_statemachine-2.5.0/tests/django_project/core/__init__,.py +0 -0
  102. python_statemachine-2.5.0/tests/django_project/core/settings.py +28 -0
  103. python_statemachine-2.5.0/tests/django_project/core/wsgi.py +16 -0
  104. python_statemachine-2.5.0/tests/django_project/manage.py +23 -0
  105. python_statemachine-2.5.0/tests/django_project/workflow/__init__.py +0 -0
  106. python_statemachine-2.5.0/tests/django_project/workflow/apps.py +6 -0
  107. python_statemachine-2.5.0/tests/django_project/workflow/models.py +23 -0
  108. python_statemachine-2.5.0/tests/django_project/workflow/statemachines.py +14 -0
  109. python_statemachine-2.5.0/tests/django_project/workflow/tests.py +66 -0
  110. python_statemachine-2.5.0/tests/examples/README.rst +9 -0
  111. python_statemachine-2.5.0/tests/examples/__init__.py +0 -0
  112. python_statemachine-2.5.0/tests/examples/air_conditioner_machine.py +68 -0
  113. python_statemachine-2.5.0/tests/examples/all_actions_machine.py +201 -0
  114. python_statemachine-2.5.0/tests/examples/async_guess_the_number_machine.py +173 -0
  115. python_statemachine-2.5.0/tests/examples/async_without_loop_machine.py +45 -0
  116. python_statemachine-2.5.0/tests/examples/enum_campaign_machine.py +60 -0
  117. python_statemachine-2.5.0/tests/examples/guess_the_number_machine.py +123 -0
  118. python_statemachine-2.5.0/tests/examples/lor_machine.py +103 -0
  119. python_statemachine-2.5.0/tests/examples/order_control_machine.py +47 -0
  120. python_statemachine-2.5.0/tests/examples/order_control_rich_model_machine.py +142 -0
  121. python_statemachine-2.5.0/tests/examples/persistent_model_machine.py +142 -0
  122. python_statemachine-2.5.0/tests/examples/recursive_event_machine.py +39 -0
  123. python_statemachine-2.5.0/tests/examples/reusing_transitions_machine.py +97 -0
  124. python_statemachine-2.5.0/tests/examples/traffic_light_machine.py +64 -0
  125. python_statemachine-2.5.0/tests/examples/user_machine.py +130 -0
  126. python_statemachine-2.5.0/tests/helpers.py +10 -0
  127. python_statemachine-2.5.0/tests/models.py +10 -0
  128. python_statemachine-2.5.0/tests/scrape_images.py +62 -0
  129. python_statemachine-2.5.0/tests/test_actions.py +22 -0
  130. python_statemachine-2.5.0/tests/test_async.py +121 -0
  131. python_statemachine-2.5.0/tests/test_callbacks.py +348 -0
  132. python_statemachine-2.5.0/tests/test_callbacks_isolation.py +73 -0
  133. python_statemachine-2.5.0/tests/test_conditions_algebra.py +65 -0
  134. python_statemachine-2.5.0/tests/test_contrib_diagram.py +89 -0
  135. python_statemachine-2.5.0/tests/test_copy.py +183 -0
  136. python_statemachine-2.5.0/tests/test_dispatcher.py +164 -0
  137. python_statemachine-2.5.0/tests/test_events.py +310 -0
  138. python_statemachine-2.5.0/tests/test_examples.py +38 -0
  139. python_statemachine-2.5.0/tests/test_listener.py +107 -0
  140. python_statemachine-2.5.0/tests/test_mixins.py +23 -0
  141. python_statemachine-2.5.0/tests/test_mock_compatibility.py +24 -0
  142. python_statemachine-2.5.0/tests/test_multiple_destinations.py +232 -0
  143. python_statemachine-2.5.0/tests/test_profiling.py +62 -0
  144. python_statemachine-2.5.0/tests/test_registry.py +45 -0
  145. python_statemachine-2.5.0/tests/test_rtc.py +262 -0
  146. python_statemachine-2.5.0/tests/test_signature.py +164 -0
  147. python_statemachine-2.5.0/tests/test_signature_positional_only.py +34 -0
  148. python_statemachine-2.5.0/tests/test_spec_parser.py +261 -0
  149. python_statemachine-2.5.0/tests/test_state.py +41 -0
  150. python_statemachine-2.5.0/tests/test_state_callbacks.py +102 -0
  151. python_statemachine-2.5.0/tests/test_statemachine.py +490 -0
  152. python_statemachine-2.5.0/tests/test_statemachine_bounded_transitions.py +58 -0
  153. python_statemachine-2.5.0/tests/test_statemachine_inheritance.py +110 -0
  154. python_statemachine-2.5.0/tests/test_threading.py +188 -0
  155. python_statemachine-2.5.0/tests/test_transition_list.py +63 -0
  156. python_statemachine-2.5.0/tests/test_transitions.py +373 -0
  157. python_statemachine-2.5.0/tests/testcases/issue308.md +121 -0
  158. python_statemachine-2.5.0/tests/testcases/issue384_multiple_observers.md +57 -0
  159. python_statemachine-2.5.0/tests/testcases/issue434.md +87 -0
  160. python_statemachine-2.5.0/tests/testcases/issue449.md +55 -0
  161. python_statemachine-2.5.0/tests/testcases/issue480.md +43 -0
  162. python_statemachine-2.5.0/uv.lock +1620 -0
  163. python_statemachine-2.3.6/statemachine/dispatcher.py +0 -159
  164. python_statemachine-2.3.6/statemachine/event.py +0 -53
  165. python_statemachine-2.3.6/statemachine/events.py +0 -31
  166. python_statemachine-2.3.6/statemachine/locale/pt_BR/LC_MESSAGES/statemachine.po +0 -91
  167. {python_statemachine-2.3.6 → python_statemachine-2.5.0}/LICENSE +0 -0
  168. {python_statemachine-2.3.6 → python_statemachine-2.5.0}/statemachine/contrib/__init__.py +0 -0
  169. {python_statemachine-2.3.6 → python_statemachine-2.5.0}/statemachine/engines/__init__.py +0 -0
  170. {python_statemachine-2.3.6 → python_statemachine-2.5.0}/statemachine/graph.py +0 -0
  171. {python_statemachine-2.3.6 → python_statemachine-2.5.0}/statemachine/i18n.py +0 -0
  172. {python_statemachine-2.3.6 → python_statemachine-2.5.0}/statemachine/mixins.py +0 -0
  173. {python_statemachine-2.3.6 → python_statemachine-2.5.0}/statemachine/model.py +0 -0
  174. {python_statemachine-2.3.6 → python_statemachine-2.5.0}/statemachine/py.typed +0 -0
  175. {python_statemachine-2.3.6 → python_statemachine-2.5.0}/statemachine/registry.py +0 -0
  176. {python_statemachine-2.3.6 → python_statemachine-2.5.0}/statemachine/utils.py +0 -0
@@ -0,0 +1,4 @@
1
+ 37fcf9818178587635fffe1bb67a9fd5024a0a45
2
+ 345d82390af35d5d70ddd39c612faa4a64b11080
3
+ d7738e9ad0a3e50bc5c87d4a75c436fb771c96f6
4
+ 5bf10afae2b214900aa58dd44b0a91e469c70631
@@ -0,0 +1 @@
1
+ github: fgmacedo
@@ -0,0 +1,15 @@
1
+ * Python State Machine version:
2
+ * Python version:
3
+ * Operating System:
4
+
5
+ ### Description
6
+
7
+ Describe what you were trying to get done.
8
+ Tell us what happened, what went wrong, and what you expected to happen.
9
+
10
+ ### What I Did
11
+
12
+ ```
13
+ Paste the command(s) you ran and the output.
14
+ If there was a crash, please include the traceback here.
15
+ ```
@@ -0,0 +1,68 @@
1
+ # This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3
+
4
+ name: Python checks
5
+
6
+ on:
7
+ push:
8
+ branches: [ "develop" ]
9
+ pull_request:
10
+ branches: [ "develop" ]
11
+
12
+ jobs:
13
+ build:
14
+ runs-on: ubuntu-latest
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
19
+
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+ - run: git fetch origin develop
23
+ - name: Set up Python ${{ matrix.python-version }}
24
+ uses: actions/setup-python@v5
25
+ with:
26
+ python-version: ${{ matrix.python-version }}
27
+ - name: Setup Graphviz
28
+ uses: ts-graphviz/setup-graphviz@v2
29
+ - name: Install uv
30
+ uses: astral-sh/setup-uv@v3
31
+ with:
32
+ enable-cache: true
33
+ cache-suffix: "python${{ matrix.python-version }}"
34
+ - name: Install the project
35
+ 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
40
+ #----------------------------------------------
41
+ # run ruff
42
+ #----------------------------------------------
43
+ - name: Linter with ruff
44
+ if: matrix.python-version == 3.13
45
+ run: |
46
+ uv run ruff check .
47
+ uv run ruff format --check .
48
+ #----------------------------------------------
49
+ # run pytest
50
+ #----------------------------------------------
51
+ - name: Test with pytest
52
+ run: |
53
+ uv run pytest --cov-report=xml:coverage.xml
54
+ uv run coverage xml
55
+ #----------------------------------------------
56
+ # upload coverage
57
+ #----------------------------------------------
58
+ - name: Upload coverage to Codecov
59
+ uses: codecov/codecov-action@v4
60
+ if: matrix.python-version == 3.13
61
+ with:
62
+ token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
63
+ directory: .
64
+ env_vars: OS,PYTHON
65
+ fail_ci_if_error: true
66
+ flags: unittests
67
+ name: codecov-umbrella
68
+ verbose: true
@@ -0,0 +1,68 @@
1
+ on:
2
+ push:
3
+ tags: [ 'v?*.*.*' ]
4
+ name: release
5
+
6
+ jobs:
7
+ release-build:
8
+ name: Build release artifacts
9
+ runs-on: ubuntu-latest
10
+
11
+ permissions:
12
+ id-token: write
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+
16
+ - run: git fetch origin develop
17
+
18
+ - name: Setup Python
19
+ uses: actions/setup-python@v5
20
+ with:
21
+ python-version: '3.13'
22
+
23
+ - name: Setup Graphviz
24
+ uses: ts-graphviz/setup-graphviz@v2
25
+
26
+ - name: Install uv
27
+ uses: astral-sh/setup-uv@v3
28
+ with:
29
+ enable-cache: true
30
+
31
+ - name: Install the project
32
+ run: uv sync --all-extras --dev
33
+
34
+ - name: Test
35
+ run: |
36
+ uv run pytest
37
+
38
+ - name: Build
39
+ run: |
40
+ uv build
41
+
42
+ - name: Upload dists
43
+ uses: actions/upload-artifact@v4
44
+ with:
45
+ name: release-dists
46
+ path: dist/
47
+
48
+
49
+ pypi-publish:
50
+ # by a dedicated job to publish we avoid the risk of
51
+ # running code with access to PyPI credentials
52
+ name: Upload release to PyPI
53
+ runs-on: ubuntu-latest
54
+ needs:
55
+ - release-build
56
+ environment: release
57
+ permissions:
58
+ id-token: write
59
+
60
+ steps:
61
+ - name: Retrieve release distributions
62
+ uses: actions/download-artifact@v4
63
+ with:
64
+ name: release-dists
65
+ path: dist/
66
+
67
+ - name: Publish package distributions to PyPI
68
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,81 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ env/
12
+ build/
13
+ develop-eggs/
14
+ dist/
15
+ downloads/
16
+ eggs/
17
+ .eggs/
18
+ lib/
19
+ lib64/
20
+ parts/
21
+ sdist/
22
+ var/
23
+ *.egg-info/
24
+ .installed.cfg
25
+ *.egg
26
+ .mypy_cache
27
+
28
+ # jupyter
29
+ .ipynb_checkpoints/
30
+ .jupyterlite.doit.db
31
+
32
+ # PyInstaller
33
+ # Usually these files are written by a python script from a template
34
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
35
+ *.manifest
36
+ *.spec
37
+
38
+ # Installer logs
39
+ pip-log.txt
40
+ pip-delete-this-directory.txt
41
+
42
+ # Unit test / coverage reports
43
+ prof/
44
+ .benchmarks/
45
+ htmlcov/
46
+ .tox/
47
+ .coverage
48
+ .coverage.*
49
+ .cache
50
+ .pytest_cache
51
+ nosetests.xml
52
+ coverage.xml
53
+ *,cover
54
+ .hypothesis/
55
+
56
+ # Translations
57
+ *.mo
58
+ *.pot
59
+
60
+ # Django stuff:
61
+ *.log
62
+
63
+ # Sphinx documentation
64
+ docs/_build/
65
+ docs/auto_examples/
66
+
67
+ # PyBuilder
68
+ target/
69
+
70
+ # pyenv python configuration file
71
+ .python-version
72
+
73
+ # IDEs and editors
74
+ *.sublime*
75
+ .idea/
76
+ .vscode/
77
+
78
+ # Sphinx-galery
79
+ docs/auto_examples/sg_execution_times.*
80
+ docs/auto_examples/*.pickle
81
+ docs/sg_execution_times.rst
@@ -0,0 +1,33 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v4.6.0
4
+ hooks:
5
+ - id: check-yaml
6
+ - id: end-of-file-fixer
7
+ exclude: docs/auto_examples
8
+ - id: trailing-whitespace
9
+ exclude: docs/auto_examples
10
+ - repo: https://github.com/charliermarsh/ruff-pre-commit
11
+ # Ruff version.
12
+ rev: v0.8.1
13
+ hooks:
14
+ # Run the linter.
15
+ - id: ruff
16
+ args: [ --fix ]
17
+ # Run the formatter.
18
+ - id: ruff-format
19
+
20
+ - repo: local
21
+ hooks:
22
+ - id: mypy
23
+ name: Mypy
24
+ entry: uv run mypy --namespace-packages --explicit-package-bases statemachine/ tests/
25
+ types: [python]
26
+ language: system
27
+ pass_filenames: false
28
+ - id: pytest
29
+ name: Pytest
30
+ entry: uv run pytest
31
+ types: [python]
32
+ language: system
33
+ pass_filenames: false
@@ -0,0 +1,23 @@
1
+ # .readthedocs.yaml
2
+ # Read the Docs configuration file
3
+ # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4
+
5
+ # Required
6
+ version: 2
7
+
8
+ build:
9
+ os: "ubuntu-22.04"
10
+ tools:
11
+ python: "3.12"
12
+ apt_packages:
13
+ - graphviz
14
+ jobs:
15
+ post_create_environment:
16
+ - asdf plugin add uv
17
+ - asdf install uv latest
18
+ - asdf global uv latest
19
+ - UV_PROJECT_ENVIRONMENT=$READTHEDOCS_VIRTUALENV_PATH uv sync --all-extras --frozen
20
+
21
+ # Build documentation in the docs/ directory with Sphinx
22
+ sphinx:
23
+ configuration: docs/conf.py
@@ -1,19 +1,17 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: python-statemachine
3
- Version: 2.3.6
3
+ Version: 2.5.0
4
4
  Summary: Python Finite State Machines made easy.
5
- Home-page: https://github.com/fgmacedo/python-statemachine
6
- License: MIT
7
- Author: Fernando Macedo
8
- Author-email: fgmacedo@gmail.com
9
- Maintainer: Fernando Macedo
10
- Maintainer-email: fgmacedo@gmail.com
11
- Requires-Python: >=3.7
5
+ Project-URL: homepage, https://github.com/fgmacedo/python-statemachine
6
+ Author-email: Fernando Macedo <fgmacedo@gmail.com>
7
+ Maintainer-email: Fernando Macedo <fgmacedo@gmail.com>
8
+ License: MIT License
9
+ Classifier: Development Status :: 5 - Production/Stable
12
10
  Classifier: Framework :: AsyncIO
11
+ Classifier: Framework :: Django
13
12
  Classifier: Intended Audience :: Developers
14
13
  Classifier: License :: OSI Approved :: MIT License
15
14
  Classifier: Natural Language :: English
16
- Classifier: Programming Language :: Python :: 3
17
15
  Classifier: Programming Language :: Python :: 3.7
18
16
  Classifier: Programming Language :: Python :: 3.8
19
17
  Classifier: Programming Language :: Python :: 3.9
@@ -21,9 +19,11 @@ Classifier: Programming Language :: Python :: 3.10
21
19
  Classifier: Programming Language :: Python :: 3.11
22
20
  Classifier: Programming Language :: Python :: 3.12
23
21
  Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Topic :: Home Automation
24
23
  Classifier: Topic :: Software Development :: Libraries
24
+ Requires-Python: >=3.7
25
25
  Provides-Extra: diagrams
26
- Requires-Dist: pydot (>=2.0.0) ; extra == "diagrams"
26
+ Requires-Dist: pydot>=2.0.0; extra == 'diagrams'
27
27
  Description-Content-Type: text/markdown
28
28
 
29
29
  # Python StateMachine
@@ -196,19 +196,19 @@ Easily iterate over all states:
196
196
 
197
197
  ```py
198
198
  >>> [s.id for s in sm.states]
199
- ['green', 'red', 'yellow']
199
+ ['green', 'yellow', 'red']
200
200
 
201
201
  ```
202
202
 
203
203
  Or over events:
204
204
 
205
205
  ```py
206
- >>> [t.name for t in sm.events]
206
+ >>> [t.id for t in sm.events]
207
207
  ['cycle']
208
208
 
209
209
  ```
210
210
 
211
- Call an event by its name:
211
+ Call an event by its id:
212
212
 
213
213
  ```py
214
214
  >>> sm.cycle()
@@ -216,7 +216,7 @@ Don't move.
216
216
  'Running cycle from yellow to red'
217
217
 
218
218
  ```
219
- Or send an event with the event name:
219
+ Or send an event with the event id:
220
220
 
221
221
  ```py
222
222
  >>> sm.send('cycle')
@@ -405,7 +405,7 @@ There's a lot more to cover, please take a look at our docs:
405
405
  https://python-statemachine.readthedocs.io.
406
406
 
407
407
 
408
- ## Contributing to the project
408
+ ## Contributing
409
409
 
410
410
  * <a class="github-button" href="https://github.com/fgmacedo/python-statemachine" data-icon="octicon-star" aria-label="Star fgmacedo/python-statemachine on GitHub">Star this project</a>
411
411
  * <a class="github-button" href="https://github.com/fgmacedo/python-statemachine/issues" data-icon="octicon-issue-opened" aria-label="Issue fgmacedo/python-statemachine on GitHub">Open an Issue</a>
@@ -413,18 +413,17 @@ https://python-statemachine.readthedocs.io.
413
413
 
414
414
  - If you found this project helpful, please consider giving it a star on GitHub.
415
415
 
416
- - **Contribute code**: If you would like to contribute code to this project, please submit a pull
416
+ - **Contribute code**: If you would like to contribute code, please submit a pull
417
417
  request. For more information on how to contribute, please see our [contributing.md](contributing.md) file.
418
418
 
419
- - **Report bugs**: If you find any bugs in this project, please report them by opening an issue
419
+ - **Report bugs**: If you find any bugs, please report them by opening an issue
420
420
  on our GitHub issue tracker.
421
421
 
422
- - **Suggest features**: If you have a great idea for a new feature, please let us know by opening
423
- an issue on our GitHub issue tracker.
422
+ - **Suggest features**: If you have an idea for a new feature, of feels something being harder than it should be,
423
+ please let us know by opening an issue on our GitHub issue tracker.
424
424
 
425
- - **Documentation**: Help improve this project's documentation by submitting pull requests.
425
+ - **Documentation**: Help improve documentation by submitting pull requests.
426
426
 
427
- - **Promote the project**: Help spread the word about this project by sharing it on social media,
427
+ - **Promote the project**: Help spread the word by sharing on social media,
428
428
  writing a blog post, or giving a talk about it. Tag me on Twitter
429
429
  [@fgmacedo](https://twitter.com/fgmacedo) so I can share it too!
430
-
@@ -168,19 +168,19 @@ Easily iterate over all states:
168
168
 
169
169
  ```py
170
170
  >>> [s.id for s in sm.states]
171
- ['green', 'red', 'yellow']
171
+ ['green', 'yellow', 'red']
172
172
 
173
173
  ```
174
174
 
175
175
  Or over events:
176
176
 
177
177
  ```py
178
- >>> [t.name for t in sm.events]
178
+ >>> [t.id for t in sm.events]
179
179
  ['cycle']
180
180
 
181
181
  ```
182
182
 
183
- Call an event by its name:
183
+ Call an event by its id:
184
184
 
185
185
  ```py
186
186
  >>> sm.cycle()
@@ -188,7 +188,7 @@ Don't move.
188
188
  'Running cycle from yellow to red'
189
189
 
190
190
  ```
191
- Or send an event with the event name:
191
+ Or send an event with the event id:
192
192
 
193
193
  ```py
194
194
  >>> sm.send('cycle')
@@ -377,7 +377,7 @@ There's a lot more to cover, please take a look at our docs:
377
377
  https://python-statemachine.readthedocs.io.
378
378
 
379
379
 
380
- ## Contributing to the project
380
+ ## Contributing
381
381
 
382
382
  * <a class="github-button" href="https://github.com/fgmacedo/python-statemachine" data-icon="octicon-star" aria-label="Star fgmacedo/python-statemachine on GitHub">Star this project</a>
383
383
  * <a class="github-button" href="https://github.com/fgmacedo/python-statemachine/issues" data-icon="octicon-issue-opened" aria-label="Issue fgmacedo/python-statemachine on GitHub">Open an Issue</a>
@@ -385,17 +385,17 @@ https://python-statemachine.readthedocs.io.
385
385
 
386
386
  - If you found this project helpful, please consider giving it a star on GitHub.
387
387
 
388
- - **Contribute code**: If you would like to contribute code to this project, please submit a pull
388
+ - **Contribute code**: If you would like to contribute code, please submit a pull
389
389
  request. For more information on how to contribute, please see our [contributing.md](contributing.md) file.
390
390
 
391
- - **Report bugs**: If you find any bugs in this project, please report them by opening an issue
391
+ - **Report bugs**: If you find any bugs, please report them by opening an issue
392
392
  on our GitHub issue tracker.
393
393
 
394
- - **Suggest features**: If you have a great idea for a new feature, please let us know by opening
395
- an issue on our GitHub issue tracker.
394
+ - **Suggest features**: If you have an idea for a new feature, of feels something being harder than it should be,
395
+ please let us know by opening an issue on our GitHub issue tracker.
396
396
 
397
- - **Documentation**: Help improve this project's documentation by submitting pull requests.
397
+ - **Documentation**: Help improve documentation by submitting pull requests.
398
398
 
399
- - **Promote the project**: Help spread the word about this project by sharing it on social media,
399
+ - **Promote the project**: Help spread the word by sharing on social media,
400
400
  writing a blog post, or giving a talk about it. Tag me on Twitter
401
401
  [@fgmacedo](https://twitter.com/fgmacedo) so I can share it too!
@@ -0,0 +1,33 @@
1
+ import sys
2
+
3
+ import pytest
4
+
5
+
6
+ @pytest.fixture(autouse=True, scope="session")
7
+ def add_doctest_context(doctest_namespace): # noqa: PT004
8
+ from statemachine import State
9
+ from statemachine import StateMachine
10
+ from statemachine.utils import run_async_from_sync
11
+
12
+ class ContribAsyncio:
13
+ """
14
+ Using `run_async_from_sync` to be injected in the doctests to better integration with an
15
+ already running loop, as all of our examples are also automated executed as doctests.
16
+
17
+ On real life code you should use standard `import asyncio; asyncio.run(main())`.
18
+ """
19
+
20
+ def __init__(self):
21
+ self.run = run_async_from_sync
22
+
23
+ doctest_namespace["State"] = State
24
+ doctest_namespace["StateMachine"] = StateMachine
25
+ doctest_namespace["asyncio"] = ContribAsyncio()
26
+
27
+
28
+ def pytest_ignore_collect(collection_path, path, config):
29
+ if sys.version_info >= (3, 10): # noqa: UP036
30
+ return None
31
+
32
+ if "django_project" in str(path):
33
+ return True
@@ -0,0 +1 @@
1
+ Please see [docs/contributing.md](docs/contributing).
@@ -0,0 +1,59 @@
1
+ /* div.sphx-glr-download {
2
+ height: 0px;
3
+ visibility: hidden;
4
+ } */
5
+
6
+ @media only screen and (min-width: 650px) {
7
+
8
+ .sphx-glr-thumbnails {
9
+ grid-template-columns: repeat(auto-fill, minmax(600px, 1fr)) !important;
10
+ }
11
+
12
+ .sphx-glr-thumbcontainer {
13
+ min-height: 320px !important;
14
+ margin: 20px !important;
15
+ justify-content: center;
16
+ }
17
+ .sphx-glr-thumbcontainer .figure {
18
+ width: 600px !important;
19
+ }
20
+ .sphx-glr-thumbcontainer img {
21
+ max-height: 250px !important;
22
+ max-width: 600px !important;
23
+ width: 100% !important;
24
+ }
25
+ .sphx-glr-thumbcontainer a.internal {
26
+ padding: 20px 10px 0 !important;
27
+ }
28
+
29
+ }
30
+
31
+ /* Gallery Donwload buttons */
32
+ div.sphx-glr-download a {
33
+ color: #404040 !important;
34
+ background-color: #f3f6f6 !important;
35
+ background-image: none;
36
+ border-radius: 4px;
37
+ border: none;
38
+ display: inline-block;
39
+ font-weight: bold;
40
+ padding: 1ex;
41
+ text-align: center;
42
+ }
43
+
44
+ div.sphx-glr-download code.download {
45
+ display: inline-block;
46
+ white-space: normal;
47
+ word-break: normal;
48
+ overflow-wrap: break-word;
49
+ /* border and background are given by the enclosing 'a' */
50
+ border: none;
51
+ background: none;
52
+ }
53
+
54
+ div.sphx-glr-download a:hover {
55
+ box-shadow: none;
56
+ text-decoration: none;
57
+ background-image: none;
58
+ background-color: #e5ebeb !important;
59
+ }