-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
198 lines (173 loc) · 4.82 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "unpy"
version = "0.3.1.dev0"
description = "Backports Python Typing Stubs"
readme = "README.md"
license = "BSD-3-Clause"
requires-python = ">=3.12"
authors = [
{name = "Joren Hammudoglu", email = "[email protected]"},
]
classifiers = [
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Code Generators",
"Topic :: Software Development :: Compilers",
"Typing :: Typed",
]
dependencies = [
"libcst>=1.5.0,<2",
"typer-slim>=0.12.5,<1",
]
[project.urls]
Repository = "https://github.com/jorenham/unpy"
Documentation = "https://github.com/jorenham/unpy?tab=readme-ov-file#unpy"
Issues = "https://github.com/jorenham/unpy/issues"
Changelog = "https://github.com/jorenham/unpy/releases"
Funding = "https://github.com/sponsors/jorenham"
[project.scripts]
unpy = "unpy.cli:app"
[tool.hatch.build.targets.sdist]
exclude = [
"/dist",
"/examples",
"/tests",
"/.cache",
"/.github",
"/.mypy_cache",
"/.pytest_cache",
"/.ruff_cache",
"/.tox",
"/.venv",
"/.vscode",
".editorconfig",
".gitignore",
".mardownlint.yaml",
".pre-commit-config.yaml",
".python-version",
"README.md",
"uv.lock",
]
[tool.hatch.build.targets.wheel]
packages = ["unpy"]
[tool.uv]
dev-dependencies = [
"basedmypy>=2.6.0",
"basedpyright>=1.19.1",
"codespell>=2.3.0",
"pre-commit>=4.0.1",
"pytest>=8.3.3",
"ruff>=0.7.1",
"tox>=4.23.2",
]
[tool.mypy]
packages = ["unpy", "tests"]
exclude = ["examples/"]
python_version = "3.12"
strict = true
disable_bytearray_promotion = true
disable_memoryview_promotion = true
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
[[tool.mypy.overrides]]
module = ["tests.*"]
# blame pytest for these
disallow_any_expr = false
disallow_any_explicit = false
disallow_any_decorated = false
[tool.pyright]
ignore = ["**/.venv"]
include = ["unpy", "examples", "tests"]
pythonPlatform = "All"
pythonVersion = "3.13"
venv = ".venv"
venvPath = "."
stubPath = "."
typeCheckingMode = "all"
reportUnusedParameter = false # dupe of ARG001
reportUnusedCallResult = false
executionEnvironments = [
{root = "examples", pythonVersion = "3.13"},
{root = "tests", pythonVersion = "3.12", reportPrivateUsage = false},
{root = "unpy", pythonVersion = "3.12"}
]
[tool.pytest.ini_options]
testpaths = ["unpy", "tests"]
addopts = ["-ra", "-v", "--strict-config", "--strict-markers", "--doctest-modules"]
doctest_optionflags = ["NORMALIZE_WHITESPACE", "ELLIPSIS"]
filterwarnings = ["error"]
log_cli_level = "INFO"
minversion = "8.3"
xfail_strict = true
[tool.ruff]
force-exclude = true
indent-width = 4
src = ["unpy"]
target-version = "py312"
[tool.ruff.format]
indent-style = "space"
line-ending = "lf"
preview = true
quote-style = "double"
[tool.ruff.lint]
preview = true
select = ["ALL"]
ignore = [
"D", # pydocstyle
"UP040", # non-pep695-type-alias
"DOC", # pydoclint
"S101", # flake8-bandit: assert
"FBT", # flake8-boolean-trap
"CPY", # flake8-copyright
"EM", # flake8-errmsg
"TD", # flake8-todos
"FIX", # flake8-fixme
"ERA", # eradicate
"TRY003", # tryceratops: raise-vanilla-args
"RUF021", # ruff: parenthesize-chained-operators
]
allowed-confusables = ["∅", "⋂", "⋃", "∆", "⊂", "⊆", "⊇", "⊃"] # set operator symbols
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["ANN201", "PLC2701", "SLF001"]
[tool.ruff.lint.mccabe]
max-complexity = 16
[tool.ruff.lint.isort]
extra-standard-library = ["_typeshed", "typing_extensions"]
[tool.ruff.lint.flake8-type-checking]
exempt-modules = ["typing", "typing_extensions"]
[tool.ruff.lint.flake8-import-conventions.extend-aliases]
ctypes = "ct"
datetime = "dt"
libcst = "cst"
[tool.ruff.lint.pydocstyle]
ignore-decorators = ["typing.overload", "typing.override"]
[tool.ruff.lint.pylint]
allow-magic-value-types = ["str", "int"]
max-args = 8
max-bool-expr = 16
max-branches = 24
max-locals = 32
max-statements = 100
[tool.tox]
isolated_build = true
env_list = ["3.12", "3.13", "precommit"]
[tool.tox.env_run_base]
description = "test with {base_python}"
skip_install = true
allowlist_externals = ["uv"]
commands_pre = [["uv", "sync", "--frozen", "--dev"]]
commands = [["uv", "run", "pytest"]]
[tool.tox.env.precommit]
description = "pre-commit"
skip_install = true
allowlist_externals = ["uv"]
commands_pre = [["uv", "sync", "--frozen", "--dev"]]
commands = [["uv", "run", "pre-commit", "run", "--all-files"]]