forked from cockpit-project/cockpit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
129 lines (116 loc) · 2.88 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
[build-system]
requires = []
backend-path = ['src']
build-backend = 'build_backend'
[tool.mypy]
mypy_path = 'src/cockpit'
exclude = '_vendor'
[[tool.mypy.overrides]]
module = ["cockpit._vendor.*"]
follow_imports = 'silent'
[tool.pylint]
max-line-length = 118
disable = [
"C0114", # Missing module docstring
"C0115", # Missing class docstring
"R0902", # Too many instance attributes
"R0903", # Too few public methods
"R0913", # Too many arguments
"R1705", # Unnecessary "else" after "return"
"W1113", # Keyword argument before variable positional arguments (PEP-570 is Python 3.8)
]
[tool.ruff]
select = [
"A", # flake8-builtins
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"DTZ", # flake8-datetimez
"E", # pycodestyle
"EXE", # flake8-executable
"F", # pyflakes
"FBT", # flake8-boolean-trap
"G", # flake8-logging-format
"I", # isort
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"PLE", # pylint errors
"PGH", # pygrep-hooks
"PT", # flake8-pytest-style
"RSE", # flake8-raise
"RUF", # ruff rules
"T10", # flake8-debugger
"TCH", # flake8-type-checking
"W", # warnings (mostly whitespace)
"YTT", # flake8-2020
]
exclude = [
".git/",
"modules/",
"node_modules/",
"pkg/",
"test/common/",
"test/verify/",
"tools/",
]
ignore = [
"A003", # Class attribute is shadowing a python builtin
"B011", # Do not `assert False` (`python -O` removes these calls), raise `AssertionError()`
"E731", # Do not assign a `lambda` expression, use a `def`
"PT011", # `pytest.raises(OSError)` is too broad
]
line-length = 118
[tool.ruff.flake8-pytest-style]
fixture-parentheses = false
mark-parentheses = false
[tool.ruff.isort]
known-first-party = ["cockpit"]
[tool.pytest.ini_options]
addopts = ['--strict-markers'] # cf. https://github.com/cockpit-project/cockpit/pull/18584#issuecomment-1490243994
pythonpath = ["src"]
testpaths = ["test/pytest"]
log_cli = true
required_plugins = ["pytest-asyncio"]
[tool.vulture]
paths = [
"src",
"test/pytest",
"tools/vulture-suppressions",
]
ignore_names = [
"do_*",
"test[A-Z0-9]*",
]
ignore_decorators = [
"@*.register_function",
"@*.getter",
"@bus.Interface.Method"
]
[tool.coverage.paths]
source = ["src", "*/site-packages"]
[tool.coverage.run]
concurrency = ["multiprocessing"]
source_pkgs = ["cockpit"]
branch = true
[tool.coverage.report]
show_missing = true
skip_covered = true
exclude_lines = [
"pragma: no cover", # default
"raise NotImplementedError",
]
[tool.tox]
legacy_tox_ini = """
[tox]
isolated_build = True
envlist = site
[testenv]
deps=
pytest-asyncio
pytest-cov
pytest-timeout
commands=
python3 -m pytest -opythonpath= --cov {posargs}
[testenv:site]
sitepackages = True
deps=
"""