-
Notifications
You must be signed in to change notification settings - Fork 59
/
pyproject.toml
133 lines (118 loc) · 4.29 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
[tool.poetry]
name = "knot-resolver"
version = "6.0.9"
description = "Knot Resolver Manager - a Python program that automatically manages the other components of the resolver"
license = "GPL-3.0-or-later"
authors = [
"Aleš Mrázek <ales.mrazek@nic.cz>",
"Václav Šraier <vaclav.sraier@nic.cz>"
]
maintainers = [
"Aleš Mrázek <ales.mrazek@nic.cz>"
]
readme = "README.md"
homepage = "https://www.knot-resolver.cz"
repository = "https://gitlab.nic.cz/knot/knot-resolver"
documentation = "https://www.knot-resolver.cz/documentation"
packages = [
{include = "knot_resolver", from = "python"}
]
exclude = ["**/*.in", "**/meson.build"]
# See currently open issue about building C extensions here:
# https://github.com/python-poetry/poetry/issues/2740
[tool.poetry.build]
script = "build_c_extensions.py"
generate-setup-file = true
[tool.poetry.dependencies]
python = "^3.8"
aiohttp = "*"
jinja2 = "*"
pyyaml = "*"
supervisor = "*"
typing-extensions = "*"
prometheus-client = { version = "*", optional = true }
[tool.poetry.extras]
prometheus = ["prometheus-client"]
[tool.poetry.group.dev.dependencies]
poetry = "^1.8.3"
pyparsing = "^3.1.1"
poethepoet = "^0.24.4"
debugpy = "^1.8.1"
[tool.poetry.group.test.dependencies]
pytest = "^8.0.1"
pytest-cov = "^4.1.0"
pytest-asyncio = "^0.23.5"
toml = "^0.10.2"
[tool.poetry.group.lint.dependencies]
ruff = "^0.6.9"
mypy = "^1.8.0"
types-pyyaml = "^6.0.12.12"
[tool.poetry.group.docs.dependencies]
sphinx = "^5.3.0"
sphinx-tabs = "^3.4.5"
sphinx-rtd-theme = "^2.0.0"
breathe = "^4.35.0"
json-schema-for-humans = "^0.47"
[tool.poetry.scripts]
kresctl = 'knot_resolver.client.main:main'
knot-resolver = 'knot_resolver.manager.main:main'
[tool.poe.tasks]
# tasks runed through scripts located in 'scripts/poe-tasks/'
configure = { cmd = "scripts/poe-tasks/configure", help = "(Re)configure Meson build directory" }
run = { cmd = "scripts/poe-tasks/run", help = "Run Knot Resolver" }
run-debug = { cmd = "scripts/poe-tasks/run-debug", help = "Debug Knot Resolver with debugpy" }
doc = { cmd = "scripts/poe-tasks/doc", help = "Create Knot Resolver HTML documentation" }
schema = { cmd = "scripts/poe-tasks/schema", help = "Generate a JSON schema of the Knot Resolver configuration"}
test = { cmd = "scripts/poe-tasks/test", help = "Run pytest unit tests" }
lint = { cmd = "scripts/poe-tasks/lint", help = "Run static code analysis (Ruff) and check typing (Mypy)" }
check = { cmd = "scripts/poe-tasks/check", help = "Check that all dependencies are properly installed and generated files are not behind project." }
examples = { cmd = "scripts/poe-tasks/examples", help = "Validate all configuration examples using 'kresctl validate' utility" }
gen-constantspy = { cmd = "scripts/poe-tasks/gen-constantspy", help = "Generate 'constants.py' module using Meson configured options" }
gen-setuppy = { cmd = "scripts/poe-tasks/gen-setuppy", help = "Generate 'setup.py' file for backwards compatibility" }
format = { cmd = "scripts/poe-tasks/format", help = "Check and fix code formatting using Ruff." }
kresctl = { cmd = "scripts/poe-tasks/kresctl", help="Run kresctl utility" }
clean = { cmd = "scripts/poe-tasks/clean", help="Cleanup build directories and files" }
[tool.ruff]
line-length = 120
target-version = "py38"
exclude = ["setup.py"]
[tool.ruff.lint]
# extend default config
# https://docs.astral.sh/ruff/rules
extend-select = [
"W", # pycodestyle warnings
"A", # flake8-builtins
"B", # flake8-bugbearp
"PL", # pylint
"N", # pep8-naming
"SLF", # flake8-self
"RET", # flake8-return
]
ignore = [
"B009", # https://docs.astral.sh/ruff/rules/get-attr-with-constant/
"PLR2004", # https://docs.astral.sh/ruff/rules/magic-value-comparison/
"PLW0603", # https://docs.astral.sh/ruff/rules/global-statement/
]
[tool.ruff.lint.isort]
known-first-party=["knot_resolver"]
[tool.mypy]
python_version = "3.8"
disallow_any_generics = true
disallow_subclassing_any = true
disallow_untyped_calls = false
disallow_untyped_decorators = true
pretty = true
show_error_codes = true
allow_redefinition = true
disallow_untyped_defs = false
strict_equality = true
disallow_incomplete_defs = true
check_untyped_defs = true
implicit_reexport = false
no_implicit_optional = true
[build-system]
requires = [
"poetry-core>=1.0.0",
"setuptools>=67.8.0"
]
build-backend = "poetry.core.masonry.api"