forked from ClusterLabs/pcs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml.in
121 lines (103 loc) · 3.03 KB
/
pyproject.toml.in
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
[project]
name = "pcs"
version = "@VERSION@"
requires-python = ">=3.12"
description = "Pacemaker/Corosync Configuration System"
authors = [
{name = "Chris Feist", email = "[email protected]"},
]
readme = "README.md"
[project.urls]
Repository = "https://github.com/ClusterLabs/pcs"
[build-system]
requires = ["setuptools >= 66.1"]
build-backend = "setuptools.build_meta"
[project.scripts]
pcs = "pcs.entry_points.cli:main"
pcsd = "pcs.entry_points.daemon:main"
pcs_snmp_agent = "pcs.entry_points.snmp_agent:main"
pcs_internal = "pcs.entry_points.internal:main"
[tool.setuptools]
# True by default in pyproject.toml, keeping old behavior
include-package-data = false
# If newly excluded packages still persist, try to remove `./*.egg-info` and
# `./build`. Don't waste time: https://stackoverflow.com/a/59686298/22796102
[tool.setuptools.packages.find]
exclude = [
"pcs_*",
"build*",
"@PACKAGE_WEBUI_BACKEND@",
]
[tool.setuptools.package-data]
pcs = ["py.typed"]
################################################################################
# NON-BUILD TOOLS
################################################################################
# Required versions of linter tools: see dev_requirements.txt
# This project should not contain any issues reported by any linter when using
# this command to run linters on the whole project:
# $ make check
[tool.ruff]
# ruff settings docs: https://docs.astral.sh/ruff/settings/
line-length = 80
target-version = "py312"
[tool.ruff.lint]
# ruff rules docs: https://docs.astral.sh/ruff/rules/
# pylint rules in ruff: # https://github.com/astral-sh/ruff/issues/970
select = [
"A",
"ARG",
"ASYNC",
"B",
"C4",
"E4",
"E7",
"E9",
"F",
"G",
"I",
"LOG",
"PERF",
"PIE",
"PL", # pylint convention, error, refactoring, warning
"RET",
"SIM",
"SLF",
"SLOT",
"TC",
]
# ruff does not respect pylint ignore directives
# https://github.com/astral-sh/ruff/issues/1203
ignore = [
"ARG005", # https://docs.astral.sh/ruff/rules/unused-lambda-argument/
"C408", # https://docs.astral.sh/ruff/rules/unnecessary-collection-call/
"SIM102", # https://docs.astral.sh/ruff/rules/collapsible-if/
]
[tool.ruff.lint.flake8-builtins]
builtins-allowed-modules = [
"json",
"logging",
"resource",
"ssl",
"types",
"xml",
]
[tool.ruff.lint.isort]
# known deviations from isort:
# https://docs.astral.sh/ruff/faq/#how-does-ruffs-import-sorting-compare-to-isort
# https://github.com/astral-sh/ruff/issues/1381
# https://github.com/astral-sh/ruff/issues/2104
known-first-party = ["pcs"]
section-order = ["future", "standard-library", "third-party", "first-party", "tests", "local-folder"]
[tool.ruff.lint.isort.sections]
"tests" = ["pcs_test"]
[tool.ruff.lint.per-file-ignores]
# Ignore `F401` https://docs.astral.sh/ruff/rules/unused-import/
"__init__.py" = ["F401"]
"pcs/entry_points/*.py" = ["F401"]
# Ignore `SLF001` https://docs.astral.sh/ruff/rules/private-member-access/
"pcs_test/**.py" = ["SLF001"]
[tool.ruff.lint.pylint]
allow-magic-value-types = ["str", "bytes", "int"]
max-args = 8
max-positional-args = 8