forked from AutoXuexiPlaywright/AutoXuexiPlaywright
-
Notifications
You must be signed in to change notification settings - Fork 4
/
pyproject.toml
193 lines (172 loc) · 5.25 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
[tool.poetry]
name = "autoxuexiplaywright"
version = "3.0.8"
description = "A tool to finish something boring."
authors = ["Noob Zhang <[email protected]>"]
license = "GPL"
packages = [{include = "autoxuexiplaywright"}]
[tool.poetry.scripts]
autoxuexiplaywright = "autoxuexiplaywright.__main__:main"
[[tool.poetry.source]]
name = "bfsu"
url = "https://mirrors.bfsu.edu.cn/pypi/web/simple"
priority = "supplemental"
[[tool.poetry.source]]
name = "tuna"
url = "https://pypi.tuna.tsinghua.edu.cn/simple"
priority = "supplemental"
[[tool.poetry.source]]
name = "sjtu"
url = "https://mirror.sjtu.edu.cn/pypi/web/simple"
priority = "supplemental"
[[tool.poetry.source]]
name = "PyPI"
priority = "primary"
[tool.poetry.dependencies]
python = ">=3.11,<3.13"
pyzbar = "^0.1.9"
qrcode = {extras = ["pil"], version = "^7.3.1"}
playwright = "^1.46.0"
m3u8 = "^6.0.0"
python-magic = "^0.4.27"
python-ffmpeg = {version = "^2.0.12", optional = true}
[tool.poetry.group.gui]
optional = true
[tool.poetry.group.gui.dependencies]
pyside6 = "^6.7.2"
[tool.poetry.group.dev]
optional = true
[tool.poetry.group.dev.dependencies]
pytest-asyncio = "^0.24.0"
pytest-playwright = "^0.5.1"
pytest-cov = "^5.0.0"
pytest-ruff = "^0.4.1"
[tool.basedpyright]
venvPath="."
venv=".venv"
reportMissingImports = true
pythonPlatform = "All"
typeCheckingMode = "strict"
useLibraryCodeForTypes = true
# diagnostic rules
strictListInference = true
strictDictionaryInference = true
strictSetInference = true
reportMissingTypeStubs = "warning"
reportImportCycles = true
reportUninitializedInstanceVariable = "warning"
reportCallInDefaultInitializer = "warning"
reportImplicitStringConcatenation = true
reportUnusedCallResult = "information"
reportUnnecessaryTypeIgnoreComment = "information"
reportImplicitOverride = "information"
reportShadowedImports = "information"
[tool.pytest.ini_options]
addopts = "--cov=autoxuexiplaywright --ruff"
required_plugins = "pytest-ruff pytest-cov"
[tool.ruff]
builtins = ["_"]
line-length = 100
extend-exclude = ["__pycache__"]
output-format = "github"
required-version = ">=0.3.4"
target-version = "py311"
[tool.ruff.lint]
preview = true
select = [
"F", # Pyflakes
"E", "W", # pycodestyle, Error, Warning
"I", # isort
"N", # pep8-naming
"D", # pydocstyle
"ANN", # flake8-annotations
"ASYNC", # flake8-async
"S", # flake8-bandit
"B", # flake8-bugbear
"A", # flake8-builtins
"COM", # flake8-commas
"C4", # flake8-comprehensions
"ISC", # flake8-implicit-str-concat
"T20", # flake8-print
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"RSE", # flake8-raise
"RET", # flake8-return
"SIM", # flake8-simplify
"ARG", # flake8-unused-arguments
"PTH", # flake8-use-pathlib
"FIX", # flake8-fixme
"ERA", # eradicate
"PL", # Pylint
"R", # Refactor
"FLY", # flynt
"FURB", # refurb
"LOG", # flake8-logging
"RUF" # Ruff specific
]
ignore = [
"ANN101", # type for self
"ANN102", # type for cls
"PLW0603", # global statements
"S311", # random is not secure
"FIX002" # todo is not critical
]
[tool.ruff.lint.per-file-ignores]
# Import core or gui according to config
"autoxuexiplaywright/__init__.py" = ["PLC0415"]
# Function is too complex
"autoxuexiplaywright/config.py" = ["PLR0912"]
# classmethod returns instance
# NoSuchEventException cannot be fixed because compatibility reason.
"autoxuexiplaywright/events.py" = ["ANN206", "N818"]
# Import ctypes only on Windows
"autoxuexiplaywright/gui/__init__.py" = ["PLC0415"]
# follow Qt's name style
# Drawing UI requires many statements
"autoxuexiplaywright/gui/*.py" = ["N815", "N802", "N806", "PLR0915", "PLR0914"]
# _ObjectIDs, magic value
"autoxuexiplaywright/gui/windows.py" = ["RUF012", "PLR6301", "PLR2004"]
# NoSuchLanguageKeyException
"autoxuexiplaywright/languages.py" = ["N818"]
# Dynamic import objects
"autoxuexiplaywright/processors/__init__.py" = ["PLC0415"]
# Size of list, method is function
# Shadows some built-in object
"autoxuexiplaywright/processors/**.py" = ["PLR6301", "PLR2004", "A004", "A005"]
# Nested block
"autoxuexiplaywright/processors/*/read.py" = ["PLR1702"]
# Dynamic import
"autoxuexiplaywright/processors/*/test.py" = ["PLC0415"]
# SQL is too long
"autoxuexiplaywright/processors/common/answer/sources.py" = ["E501"]
# playwright likes this
"autoxuexiplaywright/processors/async_api/task.py" = ["ASYNC109"]
# empty functions
"autoxuexiplaywright/sdk/module.py" = ["B027"]
# Too many nested blocks
"autoxuexiplaywright/storage.py" = ["PLR1702"]
# tests are usually using assert and private objects
# pyright is not happy when using i.attr
# test __eq__ function should not be changed to ==
# we prefers @pytest.fixture() instead @pytest.fixture
"tests/**.py" = ["S101", "PLC2701","B010", "PLC2801", "PT001"]
[tool.ruff.lint.flake8-annotations]
allow-star-arg-any = true
mypy-init-return = true
suppress-dummy-args = true
suppress-none-returning = true
[tool.ruff.lint.isort]
force-single-line = true
length-sort = true
lines-after-imports = 2
no-sections = true
[tool.ruff.lint.pycodestyle]
max-doc-length = 100
max-line-length = 100
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.format]
docstring-code-format = true
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"