-
Notifications
You must be signed in to change notification settings - Fork 3
/
pyproject.toml
165 lines (145 loc) · 4.72 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
# Black configuration
[tool.black]
line-length = 132 # 120*1.1
target-version = ["py39"] # Remember to change this if we change pins from Python 3.9!
# isort configuration
[tool.isort]
line_length = 132
profile = "google"
py_version = "39"
skip_gitignore = true
known_namespace = ['compass']
known_tests = ['tests']
sections = ['FUTURE', 'STDLIB', 'THIRDPARTY', 'NAMESPACE', 'FIRSTPARTY', "TESTS", 'LOCALFOLDER']
# mypy configuration
[tool.mypy]
#plugins = ["pydantic.mypy"] # TODO re-enable (https://github.com/samuelcolvin/pydantic/issues/2895)
# help finding errors
show_error_codes = true
show_error_context = true
# suppress errors from imported modules
follow_imports = "silent"
# warn about config that doesn't hit files
warn_unused_configs = true
# mypy --strict config:
disallow_any_generics = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_return_any = true
implicit_reexport = false
strict_equality = true
[[tool.mypy.overrides]]
module = ["lxml"]
ignore_missing_imports = true
#[[tool.mypy.overrides]]
#module = "pydantic"
#init_forbid_extra = true
#init_typed = true
#warn_required_dynamic_aliases = true
#warn_untyped_fields = true
# pytest configuration
[tool.pytest.ini_options]
minversion = "6.2"
norecursedirs = "tests/util"
testpaths = [
"tests",
]
# -rxXs -- show extra test summary info for skipped, xfailed, xpassed
addopts = "-rxXs --strict-config --strict-markers"
# use strict xfail (https://docs.pytest.org/en/latest/how-to/skipping.html#strict-parameter)
xfail_strict = true
# pylint configuration
[tool.pylint]
MASTER.persistent=false # pylint runs on CI, so no point saving
MASTER.jobs=0 # auto-detect the number of processors to use
DESIGN.max-statements=60
FORMAT.max-line-length=132
SIMILARITIES.ignore-imports=true
[tool.pylint."MESSAGES CONTROL"]
disable = [
"fixme",
"too-few-public-methods", # pydantic models have 0 public methods, we would have ~50 local excludes
"import-error", # pylint does not (2021-03-20) support namespace packages
"logging-fstring-interpolation", # f-strings are quicker than %-formatting
# https://docs.pylint.org/en/latest/faq.html#i-am-using-another-popular-linter-alongside-pylint-which-messages-should-i-disable-to-avoid-duplicates
# pycodestyle duplication
"unneeded-not",
"line-too-long",
"unnecessary-semicolon",
"trailing-whitespace",
"missing-final-newline",
"bad-indentation",
"multiple-statements",
"bare-except",
# pyflakes duplication
"undefined-variable",
"unused-import",
"unused-variable",
# McCabe duplication
"too-many-branches",
# pydocstyle duplication
"missing-module-docstring",
"missing-class-docstring",
"missing-function-docstring",
# pep8-naming duplication
"invalid-name",
"bad-classmethod-argument",
"bad-mcs-classmethod-argument",
"no-self-argument",
# isort duplication
"wrong-import-order",
]
[tool.coverage.report]
exclude_lines = [
# re-enable the standard pragma
"pragma: no cover",
# don't complain about non-runnable blocks
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
"if Settings.debug:",
]
[tool.bumper]
current_version = "0.27.0"
[[tool.bumper.file]]
src = "pyproject.toml"
template = "{major}.{minor}.{micro}"
search = 'current_version = "{current_version}"'
[[tool.bumper.file]]
src = "compass.core/src/compass/core/__init__.py"
template = "{major}.{minor}.{micro}"
search = '__version__ = "{current_version}"'
[[tool.bumper.file]]
src = "compass.core/src/compass/core/__init__.py"
template = "({major}, {minor}, {micro})"
search = "__version_info__ = {current_version}"
[[tool.bumper.file]]
src = "compass.api/src/compass/api/__init__.py"
template = "{major}.{minor}.{micro}"
search = '__version__ = "{current_version}"'
[[tool.bumper.file]]
src = "compass.api/src/compass/api/__init__.py"
template = "({major}, {minor}, {micro})"
search = "__version_info__ = {current_version}"
[[tool.bumper.file]]
src = "compass.experiments/src/compass/experiments/__init__.py"
template = "{major}.{minor}.{micro}"
search = '__version__ = "{current_version}"'
[[tool.bumper.file]]
src = "compass.experiments/src/compass/experiments/__init__.py"
template = "({major}, {minor}, {micro})"
search = "__version_info__ = {current_version}"
[[tool.bumper.file]]
src = "compass-metapackage/setup.cfg"
template = "{major}.{minor}.{micro}"
search = 'version = {current_version}'
[[tool.bumper.file]]
src = "compass-metapackage/setup.cfg"
template = "{major}.{minor}.{micro}"
search = ' compass-interface-core == {current_version}'