-
-
Notifications
You must be signed in to change notification settings - Fork 105
Expand file tree
/
Copy pathpyproject.toml
More file actions
210 lines (185 loc) · 5.63 KB
/
pyproject.toml
File metadata and controls
210 lines (185 loc) · 5.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
[project]
name = "python-statemachine"
version = "3.1.0"
description = "Python Finite State Machines made easy."
authors = [{ name = "Fernando Macedo", email = "fgmacedo@gmail.com" }]
maintainers = [{ name = "Fernando Macedo", email = "fgmacedo@gmail.com" }]
license = { text = "MIT License" }
readme = "README.md"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Framework :: AsyncIO",
"Framework :: Django",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3.9",
"Topic :: Home Automation",
"Topic :: Software Development :: Libraries",
]
requires-python = ">=3.9"
[project.urls]
homepage = "https://github.com/fgmacedo/python-statemachine"
[project.optional-dependencies]
diagrams = ["pydot >= 2.0.0"]
[dependency-groups]
dev = [
"ruff >=0.15.0",
"pre-commit",
"mypy",
"pytest",
"pytest-cov >=6.0.0; python_version >='3.9'",
"pytest-cov; python_version <'3.9'",
"pytest-sugar >=1.0.0",
"pytest-mock >=3.14.0",
"pytest-benchmark >=4.0.0",
"pytest-asyncio >=0.25.0",
"pydot",
"django >=5.2.11; python_version >='3.10'",
"pytest-django >=4.8.0; python_version >'3.8'",
"Sphinx; python_version >'3.8'",
"sphinx-gallery; python_version >'3.8'",
"myst-parser; python_version >'3.8'",
"pillow; python_version >'3.8'",
"sphinx-autobuild; python_version >'3.8'",
"furo >=2024.5.6; python_version >'3.8'",
"sphinx-copybutton >=0.5.2; python_version >'3.8'",
"pdbr>=0.8.9; python_version >'3.8'",
"babel >=2.16.0; python_version >='3.8'",
"pytest-xdist>=3.6.1",
"pytest-timeout>=2.3.1",
"pyright>=1.1.400",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["statemachine/"]
[tool.pytest.ini_options]
addopts = [
"-s",
"--ignore=docs/conf.py",
"--ignore=docs/auto_examples/",
"--ignore=docs/_build/",
"--ignore=tests/examples/",
"--doctest-glob=*.md",
"--doctest-modules",
"--doctest-continue-on-failure",
"--benchmark-autosave",
"--benchmark-group-by=name",
"--pdbcls=pdbr:RichPdb",
]
doctest_optionflags = "ELLIPSIS IGNORE_EXCEPTION_DETAIL NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL"
asyncio_mode = "auto"
markers = [
"""slow: marks tests as slow (deselect with '-m "not slow"')""",
"""scxml: marks a tests as scxml (deselect with '-m "not scxml"')""",
]
python_files = ["tests.py", "test_*.py", "*_tests.py"]
xfail_strict = true
log_cli_level = "DEBUG"
log_cli_format = "%(relativeCreated)6.0fms %(threadName)-18s %(name)-35s %(message)s"
log_cli_date_format = "%H:%M:%S"
asyncio_default_fixture_loop_scope = "module"
filterwarnings = ["ignore::pytest_benchmark.logger.PytestBenchmarkWarning"]
[tool.coverage.run]
branch = true
# dynamic_context = "test_function"
relative_files = true
data_file = ".coverage"
source = ["statemachine"]
omit = ["*test*.py", "tmp/*", "pytest_cov"]
[tool.coverage.report]
show_missing = true
exclude_lines = [
# Have to re-enable the standard pragma
"pragma: no cover",
# Don't complain about missing debug-only code:
"def __repr__",
"if self.debug",
# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError",
"if TYPE_CHECKING",
'if __name__ == "__main__"',
]
[tool.coverage.html]
directory = "tmp/htmlcov"
show_contexts = true
[tool.mypy]
python_version = "3.14"
warn_return_any = true
warn_unused_configs = true
disable_error_code = "annotation-unchecked"
mypy_path = "$MYPY_CONFIG_FILE_DIR/tests/django_project"
[[tool.mypy.overrides]]
module = ['django.*', 'pytest.*', 'pydot.*', 'sphinx_gallery.*', 'docutils.*', 'sphinx.*']
ignore_missing_imports = true
[tool.ruff]
src = ["statemachine"]
line-length = 99
target-version = "py39"
# Exclude a variety of commonly ignored directories.
exclude = [
".direnv",
".eggs",
".git",
".mypy_cache",
".nox",
".pants.d",
".ruff_cache",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"auto_examples",
"venv",
]
[tool.ruff.lint]
# Enable Pyflakes and pycodestyle rules.
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"UP", # pyupgrade
"C", # flake8-comprehensions
"B", # flake8-bugbear
"PT", # flake8-pytest-style
]
ignore = [
"UP006", # `use-pep585-annotation` Requires Python3.9+
"UP035", # `use-pep585-annotation` Requires Python3.9+
"UP037", # `remove-quotes-from-type-annotation` Not safe without `from __future__ import annotations`
"UP042", # `use-str-enum` Requires Python3.11+
]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.lint.per-file-ignores]
# Ignore `E402` (import violations) in all `__init__.py` files, and in `path/to/file.py`.
"__init__.py" = ["E402"]
"path/to/file.py" = ["E402"]
"tests/examples/**.py" = ["B018"]
[tool.ruff.lint.mccabe]
max-complexity = 10
[tool.ruff.lint.isort]
force-single-line = true
[tool.ruff.lint.pydocstyle]
# Use Google-style docstrings.
convention = "google"
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = true
mark-parentheses = true
[tool.pyright]
pythonVersion = "3.9"
typeCheckingMode = "basic"
include = ["statemachine"]