-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathpyproject.toml
225 lines (207 loc) · 5.32 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
[project]
name = "Hondana"
version = "3.6.0"
description = "An asynchronous wrapper around the MangaDex v5 API"
authors = [{ name = "Alex Nørgaard", email = "[email protected]" }]
dependencies = [
"aiohttp<4.0,>=3.9",
"aiohttp[speedups]<4.0,>=3.9; extra == \"speed\"",
"orjson; extra == \"speed\"",
]
requires-python = "<4.0,>=3.11"
readme = "README.md"
license = { file = "LICENSE" }
keywords = ["mangadex", "manga", "api", "wrapper"]
classifiers = [
"License :: OSI Approved :: MIT License",
"Intended Audience :: Developers",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Internet",
"Typing :: Typed",
]
[project.urls]
"Issue Tracker" = "https://github.com/AbstractUmbra/hondana/issues"
Discord = "https://discord.gg/aYGYJxwqe5"
repository = "https://github.com/AbstractUmbra/hondana"
[project.optional-dependencies]
speed = ["orjson", "aiohttp[speedups]"]
[project.scripts]
version = "hondana.__main__:show_version"
[tool.pdm]
distribution = true
[tool.pdm.dev-dependencies]
dev = ["ruff", "typing-extensions"]
docs = ["sphinx", "sphinxcontrib-trio", "furo"]
tests = ["pytest", "pytest-asyncio"]
[tool.pdm.build]
includes = [
"hondana",
"hondana/**/*.py",
"hondana/py.typed",
"hondana/extras/tags.json",
"hondana/extras/report_reasons.json",
"LICENSE",
]
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
[tool.ruff]
line-length = 125
target-version = "py311"
exclude = ["docs/"]
[tool.ruff.lint]
preview = true
select = [
"A",
"ANN",
"ASYNC",
"B",
"BLE",
"C4",
"COM",
"DOC",
"DTZ",
"E",
"EM",
"ERA",
"F",
"FA",
"FBT",
"FURB",
"G",
"I",
"INP",
"ISC",
"NPY",
"PD",
"PERF",
"PGH",
"PIE",
"PLC",
"PLE",
"PLW",
"PTH",
"PYI",
"Q",
"Q003",
"RET",
"RSE",
"RUF",
"S",
"SIM",
"SLOT",
"T20",
"TC",
"TID",
"TRY",
"UP",
"YTT",
]
ignore = [
"ANN401",
"DOC501", # these currently don't work with sphinx
"DOC502", # these currently don't work with sphinx
"F401",
"F402",
"F403",
"F405",
"PD011", # this is not a numpy codebase
"PERF203",
"PLC0414", # pyright ruling for `as` imports needed
"Q000",
"RUF001",
"RUF009",
"SIM105",
"TRY003", # over-eager rule
"TRY301", # unrealistic rule
"UP034",
"UP038",
]
unfixable = [
"E501", # line length handled in other ways by ruff format
"ERA", # Don't delete commented out code
]
[tool.ruff.lint.per-file-ignores]
"tests/*" = [
"S101", # we use `assert` in tests
"EM101", # testing exceptions are okay I feel
"INP001", # we don't import tests generally
]
"hondana/types_/*" = [
"INP001", # we don't use the types namespace as a package
]
"examples/*" = [
"INP001", # this is the examples directory
"T201", # we showcase examples using print
"S106", # no secure values are used
"RET504", # this is done for commenting purposes
]
[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "double"
# Like Black, indent with spaces, rather than tabs.
indent-style = "space"
# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"
[tool.ruff.lint.isort]
split-on-trailing-comma = true
combine-as-imports = true
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ruff.lint.flake8-annotations]
allow-star-arg-any = true
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
mark-parentheses = false
parametrize-names-type = "csv"
[tool.ruff.lint.flake8-quotes]
inline-quotes = "double"
[tool.ruff.lint.flake8-tidy-imports.banned-api]
# https://discuss.python.org/t/problems-with-typeis/55410/6
# https://discuss.python.org/t/problems-with-typeis/55410/46
# Until what can go into a TypeIs/TypeGuard changes, these are just dangerous.
"typing.TypeIs".msg = "TypeIs is fundamentally unsafe, even when using it as described to be safe"
"typing.TypeGuard".msg = "TypeGuard is fundamentally unsafe"
"typing_extensions.TypeIs".msg = "TypeIs is fundamentally unsafe, even when using it as described to be safe"
"typing_extensions.TypeGuard".msg = "TypeGuard is fundamentally unsafe"
[tool.pyright]
exclude = [
"**/__pycache__",
"docs/**/*.py",
"tests/_update_payloads.py",
"./_preflight.py",
]
include = ["hondana", "tests", "examples"]
useLibraryCodeForTypes = true
typeCheckingMode = "strict"
reportImportCycles = false
pythonVersion = "3.11"
[tool.pytest.ini_options]
asyncio_mode = "strict"
asyncio_default_fixture_loop_scope = "session"
testpaths = ["tests"]
[tool.pdm.scripts]
spec = "python _api_dl.py"
check = "ruff check ."
format = "ruff format --check"
pyright = "pyright"
_types = "pyright --ignoreexternal --verifytypes hondana"
types = { composite = ["pyright", "_types"] }
tests = "pytest"
docs = "sphinx-build -aEWT --keep-going docs/ docs/build" # TODO: add -n when sphinx is fixed
tags = { call = "_preflight:__update_tags" }
report_reasons = { call = "_preflight:__update_report_reasons" }
pre = { composite = [
"check",
"format",
"types",
"tests",
"docs",
"tags",
"report_reasons",
] }