-
-
Notifications
You must be signed in to change notification settings - Fork 86
/
pyproject.toml
193 lines (169 loc) · 4.93 KB
/
pyproject.toml
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
[project]
name = "python-statemachine"
version = "2.5.0"
description = "Python Finite State Machines made easy."
authors = [{ name = "Fernando Macedo", email = "[email protected]" }]
maintainers = [{ name = "Fernando Macedo", email = "[email protected]" }]
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.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Home Automation",
"Topic :: Software Development :: Libraries",
]
requires-python = ">=3.7"
[project.urls]
homepage = "https://github.com/fgmacedo/python-statemachine"
[project.optional-dependencies]
diagrams = ["pydot >= 2.0.0"]
[dependency-groups]
dev = [
"ruff >=0.8.1",
"pre-commit",
"mypy",
"pytest",
"pytest-cov",
"pytest-sugar >=1.0.0",
"pytest-mock >=3.10.0",
"pytest-benchmark >=4.0.0",
"pytest-asyncio",
"pydot",
"django >=5.0.8; 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'",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["statemachine/"]
[tool.pytest.ini_options]
addopts = [
"--ignore=docs/conf.py",
"--ignore=docs/auto_examples/",
"--ignore=docs/_build/",
"--ignore=tests/examples/",
"--cov",
"--cov-config",
".coveragerc",
"--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"')"""]
python_files = ["tests.py", "test_*.py", "*_tests.py"]
xfail_strict = true
[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",
]
[tool.coverage.html]
directory = "tmp/htmlcov"
show_contexts = true
[tool.mypy]
python_version = "3.13"
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.*']
ignore_missing_imports = true
[tool.ruff]
src = ["statemachine"]
line-length = 99
target-version = "py313"
# 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+
"UP038", # `use-pep585-annotation` Requires Python3.9+
]
# 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