-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyproject.toml
312 lines (278 loc) · 6.83 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
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
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
###############
### PROJECT ###
###############
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "deker_server_adapters"
version = "0.0.0"
description = "Plugin with server adapters for Deker"
authors = ["OpenWeather <[email protected]>"]
license = "GPL-3.0-only"
readme = "README.md"
packages = [{include = "deker_server_adapters"}]
documentation = 'https://docs.deker.io/'
homepage = 'https://deker.io/'
repository = 'https://github.com/openweathermap/deker-server-adapters'
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Topic :: Software Development :: Libraries :: Python Modules",
"Operating System :: Unix",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS :: MacOS X",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
[tool.poetry-dynamic-versioning]
vcs = "git"
style = "semver"
metadata = false
[[tool.poetry.source]]
name = "PyPI"
priority = "primary"
[[tool.poetry.source]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
priority = "supplemental"
####################
### DEPENDENCIES ###
####################
[tool.poetry.dependencies]
python = "^3.9"
httpx = "^0.27.0"
pytest-httpx = "^0.30.0"
[tool.poetry.group.dev.dependencies]
black = "^23.7.0"
coverage = "^7.3.0"
darglint = "^1.8.1"
ruff = "^0.0.284"
isort = "^5.12.0"
mypy = "^1.5.0"
mypy-extensions = "^1.0.0"
pep8-naming = "^0.13.3"
pre-commit = "^3.3.3"
ssort = "^0.11.6"
pycln = "^2.2.2"
pytest = "^7.4.0"
pytest-cov = "^4.1.0"
pytest-sugar = "^0.9.7"
pytest-mock = "^3.11.1"
flake8-pyproject = "^1.2.3"
pytest-random-order = "1.1.0"
deker = {version = "^1.1.4"}
[tool.poetry.group.docs.dependencies]
docutils = "0.17"
m2r2 = "0.3.2"
sphinx-rtd-theme = "1.2.2"
enum_tools = "0.10.0"
sphinx_toolbox = "3.5.0"
doc8 = "0.11.2"
#############
### TOOLS ###
#############
##############
# FORMATTERS #
##############
# https://black.readthedocs.io/en/stable/
[tool.black]
line-length = 120
target-version = ['py38', 'py39']
include = '\.pyi?$'
# https://pycqa.github.io/isort/
[tool.isort]
py_version = 39
sections = ['FUTURE', 'STDLIB', 'THIRDPARTY', 'FIRSTPARTY', 'LOCALFOLDER']
known_local_folder = ['deker_server_adapters', ]
profile = 'black'
atomic = true
include_trailing_comma = true
line_length = 120
lines_after_imports = 2
lines_between_types = 1
multi_line_output = 3
extend_skip = ['.md', '.json']
###########
# LINTERS #
###########
# https://mypy.readthedocs.io/en/stable/
# https://pypi.org/project/mypy-extensions/
[tool.mypy]
python_version = '3.8'
ignore_missing_imports = true
scripts_are_modules = true
allow_redefinition = true
disallow_untyped_defs = true
no_implicit_optional = true
warn_no_return = false
show_error_context = true
show_column_numbers = true
show_error_codes = true
color_output = false
pretty = true
exclude = [
'^setup\.py$',
'^tmp\.py$',
'^venv/',
'^test+\.py$',
'^conftest\.py$',
'^tests/'
]
[[tool.mypy.overrides]]
module = "tests/*"
disallow_untyped_defs = false
[tool.flake8] # code linter
# https://flake8.pycqa.org/en/latest/
# https://pypi.org/project/flake8-bugbear
# https://pypi.org/project/flake8-docstrings/
# https://pypi.org/project/flake8-import-order/
# https://pypi.org/project/flake8-pytest-style/
# https://pypi.org/project/pep8-naming/
min_python_version = 3.9
max-complexity = 15
max-doc-length = 120
max-line-length = 120
strictness = "full"
docstring_style = "sphinx"
docstring-convention = "pep257"
application_import_names = "deker_server_adapters"
import-order-style = "pycharm"
exclude = [
"venv/*",
".venv/*",
".git/*",
"__pycache__/*",
".mypy_cache/*",
".pytest_cache/*",
".idea/*",
"examples/*",
"tmp/*",
"tests/*",
"tmp.py"
]
extend-select = ["D417"]
ignore = [
"B012",
"B019",
"D100",
"D104",
"D105",
"D106",
"D107",
"D203",
"D401",
"D403",
"D404",
"DAR002",
"DAR003",
"DAR104",
"DAR105",
"DAR201",
"DAR301",
"DAR401",
"DAR501",
"I101",
"I201",
"I202",
"N807",
"N813",
"W503",
"W504",
]
[tool.pycln] # imports linter
# https://hadialqattan.github.io/pycln/#/README
all = true
diff = true
exclude = "venv/*,.venv/*,.git/*,__pycache__/*,examples/*"
[tool.doc8] # RST linter
# https://github.com/PyCQA/doc8
max-line-length = 99
[tool.ruff]
target-version = "py39"
line-length = 120
select = ["ALL"]
ignore = [
"A003",
"A002",
"ANN101",
"ANN204",
"ANN401",
"ARG002",
"B904",
"BLE001",
"D100",
"D105",
"D107",
"FA100",
"ISC001",
"N818",
"PGH004",
"PLR0913",
"SLF001",
"TRY200",
"TRY301",
"UP006",
"UP035",
"COM812"
]
[tool.ruff.pydocstyle]
convention = "pep257"
[tool.ruff.mccabe]
max-complexity = 3
[tool.ruff.pycodestyle]
max-doc-length = 120
[tool.ruff.isort]
section-order = ['future', 'standard-library', 'third-party', 'first-party', 'local-folder']
lines-after-imports = 2
lines-between-types = 1
known-local-folder = ["deker_server_adapters"]
known-third-party = ["deker", "deker_tools"]
extra-standard-library = ["zoneinfo"]
#########
# TESTS #
#########
[tool.pytest.ini_options] # pytest
# https://docs.pytest.org
# https://pypi.org/project/pytest-asyncio/
# https://pytest-cov.readthedocs.io/en/latest/
# https://pypi.org/project/pytest-pythonpath/
# https://pypi.org/project/pytest-sugar/
minversion = 7.0
asyncio_mode = "auto"
addopts = ["--ignore=tmp.py"]
norecursedirs = "data"
testpaths = "./tests"
#log_cli = true
#log_cli_level = "DEBUG"
pythonpath = ["./deker_server_adapters", "./.venv", "./venv"]
filterwarnings = ["ignore::UserWarning", 'ignore::DeprecationWarning', "ignore::ResourceWarning"]
[tool.coverage.run] # coverage
branch = true
omit = [
"tests/*",
"tmp.py",
"setup.py",
]
[tool.coverage.html]
directory = "tests/code_coverage"
[tool.coverage.report]
fail_under=80
exclude_lines = [
"no cov",
"pragma: no cover",
"if typing.TYPE_CHECKING:",
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
"pass",
"raise NotImplementedError",
"except ImportError",
"except ModuleNotFoundError",
"except Exception"
]