-
Notifications
You must be signed in to change notification settings - Fork 75
/
Copy pathpyproject.toml
176 lines (153 loc) · 4.35 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
[project]
name = "genshin"
version = "1.7.4"
description = "API wrapper for HoYoLAB/Miyoushe API built on asyncio and pydantic."
readme = "README.md"
requires-python = ">=3.9"
dependencies = ["aiohttp==3.*", "pydantic==2.*"]
license = { file = "LICENSE" }
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
"Intended Audience :: Developers",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities",
"Typing :: Typed",
]
[project.optional-dependencies]
all = [
"aiohttp-socks>=0.9.0",
"aioredis>=2.0.1",
"aiosqlite>=0.17.0",
"browser-cookie3>=0.19.1",
"click>=8.1.7",
"qrcode[pil]>=7.4.2",
"rsa>=4.9",
]
cookies = ["browser-cookie3>=0.19.1"]
auth = ["qrcode[pil]>=7.4.2", "rsa>=4.9"]
cli = ["click>=8.1.7"]
socks-proxy = ["aiohttp-socks>=0.9.0"]
docs = [
"mkdocs-material>=9.5.38",
"pdoc3>=0.11.1",
]
lint = ["ruff>=0.6.8"]
pytest = [
"coverage[toml]>=7.6.1",
"devtools>=0.12.2",
"pytest>=8.3.3",
"pytest-asyncio>=0.24.0",
"pytest-cov>=5.0.0",
"pytest-dotenv>=0.5.2",
]
reformat = ["black>=24.8.0", "ruff>=0.6.8"]
typecheck = ["mypy>=1.11.2", "pyright>=1.1.382.post0", "types-click>=7.1.8"]
redis = ["aioredis>=2.0.1"]
sqlite = ["aiosqlite>=0.17.0"]
[project.urls]
Homepage = "https://github.com/thesadru/genshin.py"
Documentation = "https://thesadru.github.io/genshin.py"
Repository = "https://github.com/thesadru/genshin.py.git"
Issues = "https://github.com/thesadru/genshin.py/issues"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["genshin"]
[tool.black]
line-length = 120
[tool.ruff]
line-length = 120
target-version = "py39"
[tool.ruff.lint]
select = ["A", "C4", "C9", "D", "E", "F", "S", "W", "T20", "PT", "RSE"]
exclude = ["tests", "test.py"]
# A001, A002, A003: `id` variable/parameter/attribute
# C408: dict() with keyword arguments
# D101: Missing docstring in public module
# D105: Missing docstring in magic method
# D106: Missing docstring Model.Config
# D400: First line should end with a period
# D419: Docstring is empty
# PT007: Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple`
# PT018: Assertion should be broken down into multiple parts
# S101: Use of assert for type checking
# S303: Use of md5
# S311: Use of pseudo-random generators
# S324: Use of md5 without usedforsecurity=False (3.9+)
ignore = [
"A001",
"A002",
"A003",
"C408",
"D100",
"D105",
"D106",
"D400",
"D419",
"PT007",
"PT018",
"S101",
"S303",
"S311",
"S324",
]
# auto-fixing too intrusive
# F401: Unused import
# F841: Unused variable
# B007: Unused loop variable
unfixable = ["F401", "F841", "B007"]
[tool.ruff.lint.per-file-ignores]
# F401: unused import.
# F403: cannot detect unused vars if we use starred import
# D10*: docstrings
# S10*: hardcoded passwords
# F841: unused variable
"**/__init__.py" = ["F401", "F403"]
"tests/**" = ["D10", "S10", "F841"]
[tool.ruff.lint.mccabe]
max-complexity = 16
[tool.ruff.lint.pycodestyle]
max-line-length = 130
[tool.ruff.lint.pydocstyle]
convention = "numpy"
ignore-decorators = ["property"]
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
[tool.pyright]
include = ["genshin"]
exclude = ["**/__init__.py", "tests/**"]
typeCheckingMode = "strict"
reportMissingTypeStubs = "none"
reportImportCycles = "none"
reportIncompatibleMethodOverride = "none" # This relies on ordering for keyword-only arguments
reportUnusedFunction = "none" # Makes usage of validators impossible
reportPrivateUsage = "none"
reportUnknownMemberType = "none"
reportUntypedFunctionDecorator = "none"
reportIncompatibleVariableOverride = "none"
[tool.mypy]
warn_unreachable = false
disallow_untyped_defs = true
ignore_missing_imports = true
# pyright
warn_unused_ignores = false
warn_redundant_casts = false
allow_redefinition = true
disable_error_code = ["return-value"]
[tool.coverage.run]
source = ["genshin"]
omit = ["**/__init__.py", "**/__main__.py"]
[tool.coverage.report]
show_missing = true
skip_covered = false
sort = "cover"
[tool.uv]
dev-dependencies = ["nox>=2024.4.15"]