-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
272 lines (255 loc) · 7.73 KB
/
pyproject.toml
File metadata and controls
272 lines (255 loc) · 7.73 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
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
[project]
name = "mpt-api-client"
version = "1.0.0"
description = "SoftwareOne Marketplace API Client for Python"
authors = [{ name = "SoftwareOne AG" }]
requires-python = ">=3.12,<4"
readme = "docs/PROJECT_DESCRIPTION.md"
license = {text = "Apache-2.0 license"}
keywords = [
"openapi",
"client",
"softwareone",
"marketplace",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3.12",
"Topic :: Utilities",
]
dependencies = [
"httpx==0.28.*",
"python-box==7.4.*",
]
[dependency-groups]
dev = [
"dependency-injector==4.48.*",
"flake8==7.3.*", # force flake8 version to have same formatting everywhere, also update in pre-commit config
"flake8-aaa==0.17.*", # also update pre-commit config
"flake8-pyproject==1.2.*", # also update pre-commit config
"freezegun==1.5.*",
"ipdb==0.13.*",
"ipython==9.*",
"mypy==1.19.*",
"pre-commit==4.5.*",
"pyfakefs==6.1.*",
"pytest==9.0.*",
"pytest-asyncio==1.3.*",
"pytest-cov==7.0.*",
"pytest-deadfixtures==3.1.*",
"pytest-mock==3.15.*",
"pytest-randomly==4.0.*",
"pytest-reportportal==5.6.*",
"pytest-rerunfailures==16.1.*",
"pytest-xdist==3.8.*",
"responses==0.26.*",
"respx==0.22.*",
"ruff==0.15.*", # force ruff version to have same formatting everywhere
"typing-extensions==4.15.*",
"wemake-python-styleguide==1.6.*",
"types-python-dateutil==2.9.*",
]
[tool.hatch.build.targets.sdist]
include = ["mpt_api_client", "docs/PROJECT_DESCRIPTION.md"]
[tool.hatch.build.targets.wheel]
include = ["mpt_api_client"]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.pytest.ini_options]
testpaths = "tests"
pythonpath = "."
addopts = "--cov=mpt_api_client --cov-report=term-missing --cov-report=xml --import-mode=importlib"
log_cli = false
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
filterwarnings = [
"ignore:Support for class-based `config` is deprecated:DeprecationWarning",
"ignore:pkg_resources is deprecated as an API:DeprecationWarning",
]
rp_project = "mpt-api-python-client"
markers = [
"flaky: mark test as flaky (may fail intermittently)",
]
[tool.coverage.run]
branch = true
relative_files = true
source = ["mpt_api_client"]
[tool.coverage.report]
exclude_also = [
"if __name__ == \"__main__\":",
"raise NotImplementedError",
]
omit = [
"*/__init__.py"
]
[tool.flake8]
allowed-domain-names = ["result"]
aaa_act_block_style = "large"
doctests = true
extend-ignore = ["WPS226", "WPS412"]
extend-exclude = [
".coverage",
".github",
".idea",
".mypy_cache",
".pytest_cache",
".ruff_cache",
"uv.lock",
".venv"
]
format = "wemake"
max-imports = 17
max-line-length = 100
select = ["AAA", "E999", "WPS"]
show-source = true
statistics = false
per-file-ignores = [
"mpt_api_client/models/model.py: WPS215 WPS110",
"mpt_api_client/mpt_client.py: WPS214 WPS235",
"mpt_api_client/resources/*: WPS215",
"mpt_api_client/resources/accounts/*.py: WPS202 WPS215 WPS214 WPS235 WPS453",
"mpt_api_client/resources/billing/*.py: WPS202 WPS204 WPS214 WPS215 WPS235 WPS110",
"mpt_api_client/resources/catalog/*.py: WPS110 WPS214 WPS215 WPS235",
"mpt_api_client/resources/catalog/products.py: WPS204 WPS214 WPS215 WPS235",
"mpt_api_client/resources/commerce/*.py: WPS235 WPS215",
"mpt_api_client/rql/query_builder.py: WPS110 WPS115 WPS210 WPS214",
"tests/e2e/accounts/*.py: WPS430 WPS202",
"tests/e2e/billing/*.py: WPS202 WPS421 WPS118",
"tests/e2e/catalog/*.py: WPS202 WPS421",
"tests/e2e/catalog/items/*.py: WPS110 WPS202",
"tests/e2e/commerce/*.py: WPS202 WPS204 WPS453",
"tests/e2e/commerce/agreement/*.py: WPS202",
"tests/e2e/commerce/agreement/attachment/*.py: WPS202",
"tests/e2e/commerce/order/*.py: WPS202 WPS204",
"tests/e2e/commerce/order/asset/*.py: WPS211 WPS202",
"tests/e2e/commerce/subscription/*.py: WPS202",
"tests/unit/http/test_async_service.py: WPS204 WPS202",
"tests/unit/http/test_service.py: WPS204 WPS202",
"tests/unit/http/mixins/*: WPS204 WPS202 WPS210",
"tests/unit/resources/accounts/*.py: WPS204 WPS202 WPS210",
"tests/unit/resources/catalog/test_products.py: WPS202 WPS210",
"tests/unit/resources/commerce/*.py: WPS202 WPS204",
"tests/unit/test_mpt_client.py: WPS235",
"tests/*: WPS432 WPS202",
]
[tool.ruff]
# Ruff config: https://docs.astral.sh/ruff/settings
preview = true
target-version = "py312"
output-format = "full"
line-length = 100
[tool.ruff.format]
quote-style = "double"
# This is only required because we have invalid on-purpose code in docstrings:
docstring-code-format = false
[tool.ruff.lint]
select = [
"A", # flake8-builtins
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"C90", # maccabe
"COM", # flake8-commas
"D", # pydocstyle
"DTZ", # flake8-datetimez
"E", # pycodestyle
"ERA", # flake8-eradicate
"EXE", # flake8-executable
"F", # pyflakes
"FBT", # flake8-boolean-trap
"FLY", # pyflint
"FURB", # refurb
"G", # flake8-logging-format
"I", # isort
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"LOG", # flake8-logging
"N", # pep8-naming
"PERF", # perflint
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"Q", # flake8-quotes
"RET", # flake8-return
"RSE", # flake8-raise
"RUF", # ruff
"S", # flake8-bandit
"SIM", # flake8-simpify
"SLF", # flake8-self
"SLOT", # flake8-slots
"T100", # flake8-debugger
"TRY", # tryceratops
"UP", # pyupgrade
"W", # pycodestyle
"YTT", # flake8-2020
]
ignore = [
"A005", # allow to shadow stdlib and builtin module names
"B904", # Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling
"COM812", # trailing comma, conflicts with `ruff format`
# Different doc rules that we don't really care about:
"D100",
"D104",
"D105", # docstring for magic methods
"D106",
"D107",
"D203",
"D212",
"D401",
"D404",
"D405",
"ISC001", # implicit string concat conflicts with `ruff format`
"ISC003", # prefer explicit string concat over implicit concat
"PLR09", # we have our own complexity rules
"PLR2004", # do not report magic numbers
"PLR6301", # do not require classmethod / staticmethod when self not used
"PT011", # pytest.raises({exception}) is too broad, set the match parameter or use a more specific exception
"TRY003", # long exception messages from `tryceratops`
]
external = [ "AAA", "WPS" ]
# Plugin configs:
[tool.ruff.lint.flake8-import-conventions]
banned-from = ["ast", "datetime"]
aliases = { datetime = "dt" }
[tool.ruff.lint.flake8-quotes]
inline-quotes = "double"
[tool.ruff.lint.mccabe]
max-complexity = 6
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.per-file-ignores]
"tests/*.py" = [
"D101", # do not require docstrings in public classes
"D102", # do not require docstrincs in public method
"D103", # missing docstring in public function
"PLR2004", # allow magic numbers in tests
"S101", # asserts
"S105", # hardcoded passwords
"S404", # subprocess calls are for tests
"S603", # do not require `shell=True`
"S607", # partial executable paths
]
[tool.mypy]
# The mypy configurations: http://bit.ly/2zEl9WI
enable_error_code = [
"truthy-bool",
"truthy-iterable",
"redundant-expr",
"unused-awaitable",
"ignore-without-code",
"possibly-undefined",
"redundant-self",
"explicit-override",
"mutable-override",
"unimported-reveal",
"deprecated",
]
exclude = ["tests"]
exclude_gitignore = true
ignore_missing_imports = true
local_partial_types = true
strict = true
warn_unreachable = true