-
Notifications
You must be signed in to change notification settings - Fork 3
/
pyproject.toml
281 lines (236 loc) · 8.01 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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
# ==================================================================
# | Project |
# ==================================================================
[project]
name = "pyventus"
dynamic = ["version"]
description = "A powerful Python library for event-driven and reactive programming."
requires-python = ">=3.10"
readme = "README.md"
license = "MIT"
authors = [{ name = "Manuel Da Pena", email = "[email protected]" }]
keywords = [
"events",
"event-emitters",
"event-dispatchers",
"event-handlers",
"event-linkers",
"event-driven",
"python",
]
classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development",
"Typing :: Typed",
]
dependencies = [
"typing-extensions>=4.8.0",
]
# ==================================================================
# | Project URLs |
# ==================================================================
[project.urls]
Homepage = "https://github.com/mdapena/pyventus"
Documentation = "https://mdapena.github.io/pyventus"
Repository = "https://github.com/mdapena/pyventus"
# ==================================================================
# | Project Optional Dependencies |
# ==================================================================
[project.optional-dependencies]
# =================================
# | Package dependencies
# =================================
rq = ["rq>=1.15.0"]
celery = ["celery>=5.3.5"]
fastapi = ["fastapi>=0.95.2"]
all = [
"pyventus[rq]",
"pyventus[celery]",
"pyventus[fastapi]",
]
# =================================
# | Docs dependencies
# =================================
docs = [
"mkdocs-material>=9.5.37",
"mkdocstrings[python]>=0.26.1",
"mkdocs-git-revision-date-localized-plugin>=1.2.9",
"mkdocs-git-committers-plugin-2>=2.3.0",
"mkdocs-material[imaging]",
"mike>=2.1.3",
]
# =================================
# | Tests dependencies
# =================================
tests = [
"pyventus[all]",
"mypy>=1.11.0",
"ruff>=0.6.8",
"pytest>=8.0.0",
"pytest-asyncio>=0.24.0",
"coverage[toml]>=7.6.1",
"fakeredis>=2.25.0",
"httpx>=0.23.0",
"tqdm>=4.66.5",
]
# =================================
# | Dev dependencies
# =================================
dev = [
"pyventus[docs]",
"pyventus[tests]",
"hatch>=1.12.0",
]
# ==================================================================
# | Project Version |
# ==================================================================
[tool.hatch.version]
path = "src/pyventus/__init__.py"
# ==================================================================
# | Project Build Targets |
# ==================================================================
[tool.hatch.build.targets.sdist]
include = [
"/src",
"/tests",
"/.gitignore",
"/pyproject.toml",
"/CITATION.cff",
"/README.md",
"/LICENSE",
]
[tool.hatch.build.targets.wheel]
packages = ["src/pyventus"]
# ==================================================================
# | Hatch Environments |
# ==================================================================
# =================================
# | Tests environment
# =================================
[tool.hatch.envs.tests]
dependencies = ["pyventus[tests]"]
[tool.hatch.envs.tests.scripts]
test = "pytest -v {args:tests}"
style = "ruff check {args:.} & ruff format --check {args:.}"
typing = "mypy"
cov = [
"coverage run -m pytest -v {args:tests}",
"- coverage combine",
"coverage report",
"coverage xml",
"coverage html",
]
all = [
"style",
"typing",
"cov",
]
[[tool.hatch.envs.tests.matrix]]
python = ["3.10", "3.11", "3.12", "3.13"]
# =================================
# | Docs environment
# =================================
[tool.hatch.envs.docs]
dependencies = ["pyventus[docs]"]
[tool.hatch.envs.docs.scripts]
build = "mkdocs build --clean --strict"
serve = "mkdocs serve --dev-addr localhost:8000"
# ==================================================================
# | Configurations |
# ==================================================================
# =================================
# | Pytest configuration
# =================================
[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
# =================================
# | Coverage configuration
# =================================
[tool.coverage.run]
source_pkgs = ["pyventus", "tests"]
parallel = true
omit = [
"tests/benchmarks/*.py",
]
[tool.coverage.report]
exclude_lines = [
"no cov",
"def __repr__",
"if\\s+(self|cls)\\.(_*debug|([a-zA-Z_][a-zA-Z0-9_]*)\\.debug_enabled):",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
'@(abc\.)?abstractmethod',
]
# =================================
# | mypy configuration
# =================================
[tool.mypy]
files = ["src/pyventus", "tests"]
namespace_packages = false
show_error_codes = true
warn_no_return = true
warn_unreachable = true
warn_unused_ignores = true
implicit_reexport = true
ignore_missing_imports = true
strict = true
# =================================
# | Ruff configuration
# =================================
[tool.ruff]
include = ["pyproject.toml", "src/pyventus/*.py", "tests/*.py"]
target-version = "py310"
line-length = 120
[tool.ruff.format]
quote-style = "double" # Like Black, use double quotes for strings.
[tool.ruff.lint]
select = [
"F", # Pyflakes
"E", # pycodestyle (Error)
"I", # isort
"N", # pep8-naming
"D", # pydocstyle
"UP", # pyupgrade
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"T10", # flake8-debugger
"T20", # flake8-print
"PYI006", # flake8-pyi (bad-version-info-comparison)
"RUF100", # Ruff-specific rules (unused-noqa)
]
ignore = [
"E111", # Ignore indentation-with-invalid-multiple rule; formatter enforces consistent indentation.
"E114", # Ignore indentation-with-invalid-multiple-comment rule; formatter enforces consistent indentation.
"E117", # Ignore over-indented rule; formatter enforces consistent indentation.
"N818", # Ignore error-suffix-on-exception-name rule; pyventus uses Exception suffix.
"D100", # Ignore undocumented-public-module rule; module names imply their content.
"D206", # Ignore indent-with-spaces rule; formatter enforces consistent indentation.
"D300", # Ignore triple-single-quotes rule; formatter enforces consistent quotes.
]
[tool.ruff.lint.isort]
known-third-party = ["pyventus"]
[tool.ruff.lint.pydocstyle]
convention = "pep257"
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"] # Ignore unused imports for init files.
"tests/*.py" = ["D"] # Ignore pydocstyle rules for test files.
"tests/pyventus/core/utils/test_callable_utils.py" = ["B905", "C416"] # zip-without-explicit-strict/unnecessary-comprehension.
"!src/pyventus/{core, events, reactive}/__init__.py" = ["D104"] # Apply undocumented-public-package rule.
# ==================================================================
# | end-of-file |
# ==================================================================