-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathpyproject.toml
More file actions
128 lines (117 loc) · 3.21 KB
/
Copy pathpyproject.toml
File metadata and controls
128 lines (117 loc) · 3.21 KB
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
[project]
name = "xcp-ng-tests"
version = "0.1.0"
description = "Testing scripts for XCP-ng"
readme = "README.md"
requires-python = ">=3.11"
dependencies = [
"cryptography>=3.3.1",
"gitpython",
"legacycrypt",
"packaging>=26.1",
"pluggy>=1.1.0",
"pydantic",
"pytest>=8.0.0",
"pytest-dependency",
"requests",
]
[dependency-groups]
dev = [
"bs4>=0.0.1",
"mypy",
"flake8",
"flake8-pyproject",
"pydocstyle",
"pyright",
"ruff",
"types-requests",
"typing-extensions",
"libarchive-c==5.3",
"types-pygments",
"types-colorama",
"types-pexpect",
"zizmor",
]
[tool.pyright]
typeCheckingMode = "standard"
[tool.ruff]
preview = true
line-length = 120
exclude = ["data.py", "vm_data.py", ".git"]
[tool.ruff.format]
quote-style = "preserve"
[tool.ruff.lint]
select = [
"D", # pydocstyle
"F", # Pyflakes
"I", # isort
"SLF", # flake8-self
"SIM", # flake8-simplify
"UP007", # non-pep604-annotation-union
]
# don't use some of the default D and SIM rules
ignore = [
"D100", # undocumented-public-module
"D101", # undocumented-public-class
"D102", # undocumented-public-method
"D103", # undocumented-public-function
"D104", # undocumented-public-package
"D105", # undocumented-magic-method
"D106", # undocumented-public-nested-class
"D107", # undocumented-public-init
"D200", # unnecessary-multiline-docstring
"D203", # incorrect-blank-line-before-class
"D204", # incorrect-blank-line-after-class
"D205", # missing-blank-line-after-summary
"D210", # surrounding-whitespace
"D212", # incorrect-blank-line-before-class
"D400", # missing-trailing-period
"D401", # non-imperative-mood
"D403", # first-word-uncapitalized
"SIM105", # suppressible-exception
"SIM108", # if-else-block-instead-of-if-exp
]
# restrict to the PEP 257 rules
pydocstyle.convention = "pep257"
[tool.ruff.lint.extend-per-file-ignores]
# Pytest fixtures are often flagged as unused imports (F401) or
# redefined variables (F811) because they are injected by name.
"tests/**/*.py" = [
"F401", # F401 unused-import
"F811", # F811 redefined-while-unused
]
"conftest.py" = [
"F401", # F401 unused-import
"F811", # F811 redefined-while-unused
]
[tool.ruff.lint.isort.sections]
testing = ["pytest*"]
typing = ["typing"]
[tool.ruff.lint.isort]
lines-after-imports = 1
section-order = [
"future",
"testing",
"standard-library",
"third-party",
"first-party",
"local-folder",
"typing",
]
# ruff doesn't provide all the pycodestyle rules, and pycodestyle is not well
# supported by some IDEs, so we use flake8 for that
[tool.flake8]
max-line-length = 120
ignore = [
"E261", # At least two spaces before inline comment
"E302", # Expected 2 blank lines, found 0
"E305", # Expected 2 blank lines after end of function or class
"W503", # Line break occurred before a binary operator
"F", # already done by ruff
]
exclude=[".git", ".venv", "data.py", "vm_data.py"]
[tool.uv]
# fedora is changing the defaults: https://src.fedoraproject.org/rpms/uv/blob/f43/f/uv.toml
# We force them back to the upstream value, so we can just download the expected python version
python-downloads = "automatic"
python-preference = "managed"