-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
347 lines (305 loc) · 8.82 KB
/
pyproject.toml
File metadata and controls
347 lines (305 loc) · 8.82 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
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
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
[project]
name = "typechecked"
dynamic = ["version"]
requires-python = ">=3.10"
description = "Runtime type checking using type hints."
authors = [
{name = "Jerilyn Franz", email = "opensource@snowhare.com"}
]
maintainers = [
{name = "Jerilyn Franz", email = "opensource@snowhare.com"}
]
readme = "README.rst"
keywords = [
"typehint",
"type-hints",
"typechecking",
"type-checking",
"typechecked",
"type-checked",
"runtime",
"runtime-validation",
"validation",
"typing",
"developer-tools",
"python",
"static-analysis",
"type-safety",
"type-enforcement"
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"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 :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development",
"Typing :: Typed",
]
dependencies = [
"typing-extensions>=4.10.0"
]
[project.urls]
Homepage = "https://github.com/JerilynFranz/python-typechecked"
Documentation = "https://python-typechecked.readthedocs.io/en/latest/"
Repository = "https://github.com/JerilynFranz/python-typechecked.git"
Issues = "https://github.com/JerilynFranz/python-typechecked/issues"
Changelog = "https://github.com/JerilynFranz/python-typechecked/blob/main/CHANGELOG.rst"
[dependency-groups]
# Dependencies for running the test suite
test = [
"pytest>=7.4.1,<9.0.0",
"pytest-cov>=4.2.1",
"coverage>=6.10.6",
]
# Dependencies for linting and code style
lint = [
"flake8>=6.3.0",
"Flake8-pyproject>=1.2.4",
"isort>=5.12.0",
"mypy>=1.13.1",
"pylint>=3.1.8",
"pytest>=7.4.1,<9.0.0",
"yapf>=0.40.0",
]
# Dependencies for building documentation
docs = [
"furo>=2025.09.25",
"sphinx>=8.2.3,<9.0.0",
"sphinx-copybutton>=0.5.2",
"sphinx-design>=0.6.1",
]
# A group for all other development tools
tools = [
"hatch>=1.13",
"hatchling>=1.27",
"pydeps>=1.23.2",
"tox>=4.22.0",
"tox-uv>=1.13.1",
"uv>=0.9.18",
]
[tool.tox]
requires = ["tox>=4.22"]
env_list = [
"py31{0-4}",
"lint",
]
install_command = ["uv", "pip", "install", "{opts}", "{packages}"]
# labels table for grouping environments
[tool.tox.labels]
test = ["py310", "py311", "py312", "py313", "py314", "pypy310", "pypy311", "doctest", "lint"]
# --- Base Test Environment for automation of 'run' from env_list -
[tool.tox.env_run_base]
description = "Run test under {base_python}"
allowlist_externals = ["pytest", "flake8", "pylint", "mypy", "coverage"]
dependency_groups = ["test", "lint", "tools"]
extras = ["all"]
commands = [
["coverage", "run", "-m", "pytest", { replace = "posargs", extend = true }],
["coverage", "report"],
]
# --- Concrete Test Environments ---
# environments table
[tool.tox.env]
# tox devenv -e dev
[tool.tox.env.dev]
description = "Development environment with all tools"
package = "editable"
dependency_groups = ["test", "tools", "lint"]
base = ["testenv"]
base_python = ["python3.12", "python3.11", "python3.13", "python3.14"]
allowlist_externals = ["pytest", "mypy", "flake8", "pylint", "coverage"]
commands = []
[tool.tox.env.lint]
description = "Run linters"
package = "skip"
base_python = ["python3.10", "python3.11", "python3.12", "python3.13", "python3.14"]
dependency_groups = ["lint"]
commands = [
["flake8", "src", "tests"],
["pylint", "src", "tests"],
["mypy", "src", "tests"],
]
[tool.mypy]
exclude = ["venv"]
mypy_path = "tests,src"
[tool.tox.env.docs]
# This environment is self-contained and does NOT inherit from basetest.
description = "Build the documentation"
base_python = ["python3.12"]
dependency_groups = ["docs", "test"]
extras = ["all"]
allowlist_externals = ["sphinx-build", "sphinx-apidoc", "pydeps"]
commands = [
["pydeps", "src/typechecked"],
["sphinx-apidoc", "--separate", "--remove-old", "--module-first", "-f", "-o", "docs_source/source", "src"],
["sphinx-build", "-b", "html", "docs_source/", "documentation/"],
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/typechecked"]
exclude = [
".trunk/",
".git/",
".gitignore",
"coverage/",
"tests/",
".github/",
"bootstrap.py",
".python-version",
".readthedocs.yaml",
".vscode/",
"coverage_html_report/",
"documentation/",
"examples/",
"docs/",
"python-typechecked.code-workspace",
"docs_source/",
"README.rst",
"CODE_OF_CONDUCT.rst",
"MODULE.bazel",
"BUILD.bazel",
"WORKSPACE.bazel",
]
[tool.hatch.build.targets.sdist]
exclude = [
".trunk/",
".git/",
"coverage/",
"coverage_html_report/",
"examples/",
]
[tool.hatch.version]
path = "src/typechecked/_meta.py"
[tool.pyright]
include = ["src", "tests", "bench"]
exclude = ["**/node_modules",
"**/__pycache__",
"src/experimental",
"src/typestubs"
]
ignore = []
defineConstant = { DEBUG = true }
reportMissingImports = "error"
reportUnnecessaryIsInstance = false
[tool.flake8]
max-line-length = 120
max-complexity = 20
# E203: whitespace before ':' (conflicts with black)
# E501: line too long (handled by pylint)
extend-ignore = ["E203", "E501"]
[tool.isort]
line_length = 120
# Mode 3 - Vertical Hanging Indent
multi_line_output = 3
include_trailing_comma = true
[tool.yapf]
based_on_style = "pep8"
column_limit = 120
spaces_before_comment = 2
allow_multiline_lambdas = true
allow_split_before_dict_value = false
split_before_logical_operator = true
join_multiple_lines = false
split_arguments_when_comma_terminated = true
indent_dictionary_value = true
dedent_closing_brackets = true
coalese_brackets = true
split_before_dot = false
split_before_first_argument = true
split_before_named_assigns = true
[tool.pylint.format]
max-line-length = 120
[tool.pylint.'MESSAGES CONTROL']
disable = ["R0401", "R0801", "R0903", "R0902", "R0912", "R0913","R0915", "R0917"]
[tool.pylint.MASTER]
[tool.pytest.ini_options]
testpaths = "tests"
norecursedirs = ".git .tox .vscode venv* .*_cache build dist"
[tool.coverage.run]
branch = true
source = ["typechecked"]
omit = [
"tests/*",
"bootstrap.py",
"test_plan.py"
]
[tool.coverage.report]
# Regexes for lines to exclude from consideration
fail_under = 80
exclude_also = [
# 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",
# Don't complain if non-runnable code isn't run:
"if 0:",
"if __name__ == .__main__.:",
# Don't complain about code only used by type checking tools:
"if TYPE_CHECKING:",
"def .*: \\.\\.\\.$",
# Don't complain about abstract methods, they aren't run:
"@(abc\\.)?abstractmethod",
]
ignore_errors = true
[tool.coverage.html]
directory = "coverage_html_report"
# Configuration for generating a dependency graph
# See https://pypi.org/project/pydeps/
# You may need to install graphviz separately
# (e.g. `brew install graphviz` on macOS, `sudo apt install graphviz` on Debian/Ubuntu)
# Also, you may need to install the `graphviz` Python package
# (e.g. `pip install graphviz` in your development environment)
# The output file will be created at the specified location
# relative to the project root
# run 'pydeps src/typechecked' from the root directory of the project to generate the graph
[tool.pydeps]
format = "svg"
max_bacon = 1
max_cluster_size = 2
max_module_depth = 5
output = "docs_source/_static/images/dependencies.svg"
reverse = true
cluster = true
rankdir = "BT"
no_show = true
verbose = 0
pylib = false
exclude_exact = [
"typechecked._meta",
"typechecked._doc_utils",
"typechecked._error_tags",
"typechecked._exceptions",
"typechecked._check_result",
"typechecked._constants",
"typechecked._immutable._error_tags",
"typechecked._immutable._immutable",
"typechecked._immutable._protocol",
"typechecked._log",
"typechecked._meta",
"typechecked._options",
"typechecked._primitives",
"typechecked._typing._typeddict_key_info",
"typechecked._validate",
"typechecked._validation_cache",
"typechecked._validation_cache._cache_entry",
"typechecked._validation_cache._cache_key",
"typechecked._validation_cache._cache",
"typechecked._validation_cache._error_tags",
"typechecked._validation_state",
]