-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
160 lines (133 loc) · 4.76 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
[build-system]
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"
[tool.setuptools_scm]
[tool.pytest.ini_options]
addopts = "-q"
filterwarnings = [
"error", # Fail the tests if there are any warnings.
"ignore:^find_module\\(\\) is deprecated and slated for removal in Python 3.12; use find_spec\\(\\) instead$:DeprecationWarning:importlib",
"ignore:^FileFinder.find_loader\\(\\) is deprecated and slated for removal in Python 3.12; use find_spec\\(\\) instead$:DeprecationWarning:importlib",
"ignore:^pkg_resources is deprecated as an API:DeprecationWarning:pkg_resources",
"ignore:^pkg_resources is deprecated as an API:DeprecationWarning:pyramid",
"ignore:^Deprecated call to .pkg_resources\\.declare_namespace\\('.*'\\).\\.:DeprecationWarning:pkg_resources",
"ignore:^'cgi' is deprecated and slated for removal in Python 3\\.13$:DeprecationWarning:webob",
]
[tool.pydocstyle]
ignore = [
# Missing docstrings.
"D100","D101","D102","D103","D104","D105","D106","D107",
# "No blank lines allowed after function docstring" conflicts with the
# Black code formatter which insists on inserting blank lines after
# function docstrings.
"D202",
# "1 blank line required before class docstring" conflicts with another
# pydocstyle rule D211 "No blank lines allowed before class docstring".
"D203",
# "Multi-line docstring summary should start at the first line"
# and "Multi-line docstring summary should start at the second line".
# These two rules conflict with each other so you have to disable one of them.
# How about we disable them both? PEP 257 says either approach is okay:
#
# > The summary line may be on the same line as the opening quotes or on
# > the next line.
# >
# > https://peps.python.org/pep-0257/#multi-line-docstrings
"D212",
"D213",
]
[tool.coverage.run]
branch = true
parallel = true
source = ["h_assets", "tests/unit"]
omit = [
"*/h_assets/__main__.py",
]
[tool.coverage.paths]
source = ["src", ".tox/*tests/lib/python*/site-packages"]
[tool.coverage.report]
show_missing = true
precision = 2
fail_under = 100.00
skip_covered = true
[tool.isort]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
line_length = 88
default_section = "THIRDPARTY"
known_first_party = ["h_assets", "tests"]
[tool.pylint.main]
jobs = 0 # Use one process for CPU.
load-plugins = [
"pylint.extensions.bad_builtin",
"pylint.extensions.check_elif",
"pylint.extensions.docparams",
"pylint.extensions.mccabe",
"pylint.extensions.overlapping_exceptions",
"pylint.extensions.redefined_variable_type",
]
# Fail if there are *any* messages from PyLint.
# The letters refer to PyLint's message categories, see
# https://pylint.pycqa.org/en/latest/messages/messages_introduction.html
fail-on = ["C", "E", "F", "I", "R", "W"]
[tool.pylint.messages_control]
ignore-paths=[
]
enable = [
"bad-inline-option",
"deprecated-pragma",
"useless-suppression",
"use-symbolic-message-instead",
"use-implicit-booleaness-not-comparison-to-zero",
"use-implicit-booleaness-not-comparison-to-string",
]
disable = [
# Docstrings are encouraged but we don't want to enforce that everything
# must have a docstring.
"missing-docstring",
# We don't always want to have to put a `:return:` in a docstring.
"missing-return-doc",
# We don't always want to have to put an `:rtype:` in a docstring.
"missing-return-type-doc",
# We don't want to have to document the type of every parameter with a
# `:type:` in the docstring.
"missing-type-doc",
# We use isort to sort and group our imports, so we don't need PyLint to
# check them for us.
"ungrouped-imports",
# We use Black to format our code automatically, so we don't need PyLint to
# check formatting for us.
"line-too-long",
# We use isort to sort out imports so we don't need PyLint to check import
# ordering for us.
"wrong-import-order",
"too-few-public-methods",
# Issues to disable this for false positives, disabling it globally in the meantime https://github.com/PyCQA/pylint/issues/214
"duplicate-code",
]
good-names = [
"i", "j", "k", "ex", "Run", "_", # PyLint's default good names.
"tm", "db", "ai",
]
[tool.pylint.reports]
output-format = "colorized"
score = "no"
[tool.mypy]
allow_untyped_globals = true
error_summary = false
pretty = true
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
disable_error_code = [
# https://mypy.readthedocs.io/en/stable/error_code_list.html#code-import-untyped
"import-untyped",
]
[[tool.mypy.overrides]]
module= [
# Don't try to typecheck the tests for now
"tests.*",
]
ignore_errors = true