-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
pyproject.toml
277 lines (241 loc) · 6.09 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "mainpy"
description = "Simplify your project entrypoint with @main"
version = "1.4.1dev0"
authors = [
{name = "Joren Hammudoglu", email = "[email protected]"},
]
license = {text = "MIT"}
readme = "README.md"
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Typing :: Typed",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
requires-python = ">=3.9"
dependencies = []
[project.urls]
Repository = "https://github.com/jorenham/mainpy"
Documentation = "https://github.com/jorenham/mainpy?tab=readme-ov-file#mainpy"
Issues = "https://github.com/jorenham/mainpy/issues"
Changelog = "https://github.com/jorenham/mainpy/releases"
Funding = "https://github.com/sponsors/jorenham"
[project.optional-dependencies]
uvloop = [
# TODO: allow py313 once uvloop 0.21 is released,
"uvloop>=0.15.2,<1; sys_platform != 'win32' and python_version < '3.13'",
]
[tool.hatch.build.targets.sdist]
exclude = [
"/.cache",
"/.github",
"/.mypy_cache",
"/.pytest_cache",
"/.ruff_cache",
"/.tox",
"/.venv",
"/.vscode",
"/dist",
"/examples",
"/tests",
".editorconfig",
".gitignore",
".mardownlint.yaml",
".pre-commit-config.yaml",
".python-version",
"uv.lock",
]
[tool.uv]
dev-dependencies = [
"typing_extensions>=4.12.2",
"uvloop; sys_platform != 'win32'",
"basedmypy>=2.6.0,<3",
"basedpyright>=1.17.5,<2",
"codespell>=2.3.0,<3",
"pytest>=8.3.3,<9",
"ruff>=0.6.6,<0.7",
"pre-commit>=3.8.0",
"tox>=4.20.0",
"sp-repo-review[cli]>=2024.8.19; python_version >= '3.10'",
]
python-downloads = "manual"
[tool.codespell]
context = 2
skip = "uv.lock"
[tool.pytest.ini_options]
addopts = ["-ra", "--strict-markers", "--strict-config"]
filterwarnings = ["error"]
log_cli_level = "INFO"
minversion = "8.0"
testpaths = ["tests"]
xfail_strict = true
[tool.basedpyright]
ignore = ["**/.venv", "examples"]
include = ["mainpy", "tests"]
pythonPlatform = "All"
pythonVersion = "3.9"
stubPath = "."
typeCheckingMode = "all"
venv = ".venv"
venvPath = "."
reportUnreachable = false # unavoidable with `sys.version_info` conditionals
[tool.mypy]
packages = ["mainpy", "tests"]
exclude = ["examples/"]
python_version = "3.9"
strict = true
warn_unreachable = false
# https://github.com/KotlinIsland/basedmypy/issues/765
disable_bytearray_promotion = true
disable_memoryview_promotion = true
# required by repo-review
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.repo-review]
ignore = [
"PY004", # no docs
"PC110", # no autoformat
"PC140", # basedmypy > mypy
"PC170", # no .rst
"PC180", # no .css or .js
"RTD", # no RTD
]
[tool.ruff]
extend-exclude = [".github", ".tox", ".vscode", "dist"]
force-exclude = true
indent-width = 4
line-length = 79
show-fixes = true
src = ["mainpy", "tests"]
[tool.ruff.lint]
ignore = [
"ANN401", # flake8-annotations: any-type
"PLC0415", # pylint: import-outside-top-level
]
preview = true
select = [
"F", # pyflakes
"E", # pycodestyle error
"W", # pycodestyle warning
"I", # isort
"N", # pep8-naming
"UP", # pyupgrade
"YTT", # flake8-2020
"ANN", # flake8-annotations
"ASYNC", # flake8-async
"ASYNC1", # flake8-trio
"S", # flake8-bandit
"BLE", # flake8-blind-except
"B", # flake8-bugbear
"A", # flake8-builtins
"COM", # flake8-commas
"C4", # flake8-comprehensions
"DTZ", # flake8-datetimez
"T10", # flake8-debugger
"EXE", # flake8-executable
"FA", # flake8-future-annotations
"ISC", # flake8-implicit-str-concat
"ICN", # flake8-import-conventions
"G", # flake8-logging-format
"INP", # flake8-no-pep420
"PIE", # flake8-pie
"T20", # flake8-print
"PYI", # flake8-pyi
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"RSE", # flake8-raise
"RET", # flake8-return
"SLF", # flake8-self
"SLOT", # flake8-slots
"SIM", # flake8-simplify
"TID", # flake8-tidy-imports
"TCH", # flake8-type-checking
"ARG", # flake8-unused-arguments
"PTH", # flake8-use-pathlib
"TD", # flake8-todos
"FIX", # flake8-fixme
"ERA", # eradicate
"PD", # pandas-vet
"PGH", # pygrep-hooks
"PL", # pylint
"TRY", # tryceratops
"FLY", # flynt
"NPY", # numpy
"AIR", # airflow
"PERF", # perflint,
"FURB", # refurb
"LOG", # flake8-logging
"RUF", # ruff
]
[tool.ruff.lint.per-file-ignores]
"examples/*" = [
"INP001", # flake8-no-pep420: implicit-namespace-package
"T201", # flake8-print: print
]
"tests/*" = [
"S", # flake8-bandit
"ANN", # flake8-annotations
"ARG001", # flake8-unused-arguments: unused-function-argument
"SLF001", # flake8-self: private-member-access
]
[tool.ruff.lint.pycodestyle]
max-line-length = 79
[tool.ruff.lint.isort]
case-sensitive = true
combine-as-imports = true
known-first-party = ["mainpy"]
lines-after-imports = 2
lines-between-types = 0
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = true
[tool.ruff.lint.flake8-quotes]
inline-quotes = "single"
[tool.ruff.lint.flake8-type-checking]
strict = true
[tool.ruff.format]
docstring-code-format = true
indent-style = "space"
line-ending = "lf"
quote-style = "single"
[tool.tox]
legacy_tox_ini = """
[tox]
isolated_build = true
requires = tox>=4
envlist =
repo-review
pre-commit
py{39,310,311.312,313}
[testenv]
description = pytest
skip_install = true
allowlist_externals = uv
commands_pre = uv sync --frozen --dev
commands = uv run pytest
[testenv:pre-commit]
description = pre-commit
skip_install = true
allowlist_externals = uv
commands_pre = uv sync --frozen --dev
commands = uv run pre-commit run --all-files
[testenv:repo-review]
description = repo-review
skip_install = true
allowlist_externals = uv
commands_pre = uv sync --frozen --dev
commands = uv run repo-review .
"""