-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathpyproject.toml
More file actions
228 lines (198 loc) · 5.97 KB
/
pyproject.toml
File metadata and controls
228 lines (198 loc) · 5.97 KB
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
[project]
name = "saic_ismart_client_ng"
version = "0.9.3"
description = "SAIC next gen client library (MG iSMART)"
authors = [
{ name = "Giovanni Condello", email = "saic-python-client@nanomad.net" },
]
readme = "README.md"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
requires-python = ">=3.11"
dependencies = [
"pycryptodome (>=3.20.0,<4.0.0)",
"httpx (>=0.27.0,<0.29.0)",
"tenacity (>=9.0.0,<10.0.0)",
"dacite (>=1.8.1,<2.0.0)"
]
[project.urls]
Homepage = "https://github.com/SAIC-iSmart-API/saic-python-client-ng"
Issues = "https://github.com/SAIC-iSmart-API/saic-python-client-ng/issues"
[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry.group.dev.dependencies]
pytest = "^8.2.2"
mock = "^5.1.0"
coverage = "^7.5.4"
ruff = "^0.12.0"
pytest-cov = "^5.0.0"
pytest-asyncio = "^0.24.0"
pytest-mock = "^3.14.0"
mypy = "^1.15.0"
pylint = "^3.3.6"
pre-commit = "^4.2.0"
[tool.pytest.ini_options]
norecursedirs = ".git build dist"
testpaths = "tests"
pythonpath = [
"src"
]
mock_use_standalone_module = true
addopts = [
"--import-mode=importlib",
]
asyncio_default_fixture_loop_scope = "function"
[tool.coverage.run]
omit = [
"tests/*",
]
branch = true
command_line = "-m pytest"
[tool.coverage.report]
# Regexes for lines to exclude from consideration
exclude_lines = [
# Have to re-enable the standard pragma
'pragma: no cover',
# Don't complain about missing debug-only code:
'def __repr__',
'if self\.debug',
# Don't complain if tests don't hit defensive assertion code:
'raise AssertionError',
'raise NotImplementedError',
# Don't complain if non-runnable code isn't run:
'if 0:',
'if __name__ == .__main__.:',
]
ignore_errors = true
[tool.ruff]
include = [
"src/**/*.py",
"tests/**/*.py",
"**/pyproject.toml"
]
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"ANN401", # Opinioated warning on disallowing dynamically typed expressions
"D203", # Conflicts with other rules
"D213", # Conflicts with other rules
"EM101", # raw-string-in-exception
"D105", # Missing docstring in magic method
"D107", # Missing docstring in `__init__`
"E501", # line too long
"FBT", # flake8-boolean-trap
"PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable
# Used to map JSON responses
"N815",
# Conflicts with the Ruff formatter
"COM812",
# We use Exception istead of Error
"N818",
# Remove later
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D106", # Missing docstring in public nested class
"TD", # Todos
"A", # bultins
"DTZ", # use tz need to test it first
"TRY", # tryceratops
"FIX002", # Line contains TODO, consider resolving the issue
"BLE001", # Do not catch blind exception: `Exception`,
"PLR0913", # Too many arguments in function definition
"ERA001" # Commented-out code
]
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
[tool.ruff.lint.isort]
combine-as-imports = true
force-sort-within-sections = true
known-first-party = ["saic_ismart_client_ng"]
required-imports = ["from __future__ import annotations"]
[tool.ruff.lint.per-file-ignores]
"tests/**" = [
"D100", # Missing docstring in public module
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"N802", # Function name {name} should be lowercase
"N816", # Variable {name} in global scope should not be mixedCase
"S101", # Use of assert detected
"SLF001", # Private member accessed: {access}
"T201", # print found
]
[tool.ruff.lint.mccabe]
max-complexity = 13
[tool.ruff.lint.pylint]
max-args = 10
[tool.mypy]
files = ["./src", "./tests"]
python_version = 3.11
show_error_codes = true
strict_equality = true
warn_incomplete_stub = true
warn_redundant_casts = true
warn_unused_configs = true
warn_unused_ignores = true
check_untyped_defs = true
disallow_incomplete_defs = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
no_implicit_optional = true
warn_return_any = true
warn_unreachable = true
strict = true
[tool.pylint.MAIN]
py-version = "3.11"
ignore = ["tests"]
fail-on = ["I"]
[tool.pylint.BASIC]
good-names = ["i", "j", "k", "ex", "_", "T", "x", "y", "id", "tg"]
[tool.pylint."MESSAGES CONTROL"]
# Reasons disabled:
# format - handled by black
# duplicate-code - unavoidable
# cyclic-import - doesn't test if both import on load
# abstract-class-little-used - prevents from setting right foundation
# too-many-* - are not enforced for the sake of readability
# too-few-* - same as too-many-*
# abstract-method - with intro of async there are always methods missing
# inconsistent-return-statements - doesn't handle raise
# too-many-ancestors - it's too strict.
# wrong-import-order - isort guards this
# ---
# Pylint CodeStyle plugin
# consider-using-namedtuple-or-dataclass - too opinionated
# consider-using-assignment-expr - decision to use := better left to devs
disable = [
"format",
"cyclic-import",
"duplicate-code",
"too-many-arguments",
"too-many-instance-attributes",
"too-many-locals",
"too-many-ancestors",
"too-few-public-methods",
"invalid-name",
# Remove later
"missing-function-docstring",
"missing-module-docstring",
"missing-class-docstring",
"broad-exception-caught",
"logging-fstring-interpolation",
"fixme"
]
enable = ["useless-suppression", "use-symbolic-message-instead"]
[tool.pylint.REPORTS]
score = false
[tool.pylint.FORMAT]
expected-line-ending-format = "LF"
[tool.pylint.EXCEPTIONS]
overgeneral-exceptions = ["builtins.BaseException", "builtins.Exception"]