-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathpyproject.toml
More file actions
201 lines (180 loc) · 5.47 KB
/
pyproject.toml
File metadata and controls
201 lines (180 loc) · 5.47 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
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
[project]
# https://packaging.python.org/en/latest/specifications/declaring-project-metadata/
name = "python-libs"
dynamic = ["version"]
description = "Common Xenserver Python classes"
# 3.6 is used by XS8.4, 3.11 by XS9, versions in-between are not required
requires-python = ">=3.6, !=3.7.*, !=3.8.*, !=3.9.*, !=3.10.*"
license = {file = "LICENSE"}
keywords = ["xenserver", "xen-project", "libraries"]
authors = [
{name = "Simon Rowe"},
{name = "Andrew Cooper"},
{name = "Yann Dirson"},
]
maintainers = [
{name = "Ross Lagerwall"},
{name = "Pau Ruiz Safont"},
{name = "Bernhard Kaindl"},
]
readme = "README.md"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: System :: Hardware",
"Topic :: System :: Installation/Setup",
"Topic :: System :: Networking",
"Topic :: System :: Systems Administration",
"Topic :: Software Development :: Libraries :: Python Modules"
]
dependencies = [
# Info: xcp imports branding, but branding has no distribution, so we can't list it.
# A stub for testing is in ./stubs, which we configure to be in PYTHONPATH by pytest.
"six",
]
[project.optional-dependencies]
test = [
"mock",
"pyfakefs",
"pytest>=7",
"pytest-cov",
"pytest-forked",
"pytest_httpserver",
"pytest-localftpserver",
"pytest-subprocess",
"pytest-timeout",
"typing_extensions"
]
coverage = [
"python-libs[test]",
"coverage[toml]",
"diff_cover"
]
mypy = [
"python-libs[test]",
"lxml",
"mypy",
"mypy-extensions",
"typing_extensions",
"types-mock",
"types-six",
"types-toml",
]
pytype = [
"python-libs[test]",
"pandas",
"pytype",
]
tox = [
"tox-gh-actions",
]
[project.urls]
homepage = "https://github.com/xenserver/python-libs/"
repository = "https://github.com/xenserver/python-libs/"
[build-system]
requires = ["setuptools>=42", "setuptools_scm[toml]"]
build-backend = "setuptools.build_meta"
[tool.setuptools_scm]
# This section is needed (can be empty) for setuptools_scm to be used by "pip install ."
[tool.setuptools]
packages = ["xcp", "xcp.net", "xcp.net.ifrename"]
[tool.black]
line-length = 92
[tool.mypy]
pretty = true
show_error_context = true
error_summary = true
files = ["xcp", "tests/test_*.py"]
mypy_path = "stubs"
python_version = "3.11"
warn_redundant_casts = true
warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
explicit_package_bases = true
disallow_any_unimported = true
disallow_any_explicit = false
disallow_any_generics = true
disallow_subclassing_any = true
show_error_codes = true
strict_equality = true
# Check the contents of untyped functions in all modules by default:
check_untyped_defs = true
# xcp.cmd is to be fixed in PR #22:
[[tool.mypy.overrides]]
module = ["xcp.cmd"]
disable_error_code = ["operator", "comparison-overlap"]
# xcp.accessor is to be fixed with #24:
[[tool.mypy.overrides]]
module = ["xcp.accessor"]
disable_error_code = "union-attr"
# To be fixed with #24:
[[tool.mypy.overrides]]
module = ["xcp.net.biosdevname", "xcp.net.ifrename.logic"]
disable_error_code = ["var-annotated", "no-any-return"]
# xcp.net.ip should be fixed in PR #22, but the ip output parser works anyway:
[[tool.mypy.overrides]]
module = ["xcp.net.ip"]
disable_error_code = ["arg-type", "comparison-overlap"]
# The blame list of modules with various errors/warnings in their untyped defs,
# it shuts up 65 mypy errors, most are in cpiofile:
[[tool.mypy.overrides]]
module = [
"xcp.pci", # xcp.pci should be fixed by PR #22
"xcp.cpiofile",
"xcp.repository",
]
check_untyped_defs = false # enable to see the blame list
disable_error_code = ["var-annotated", "unreachable"]
# Most of these should be easily fixable by adding type annotations as comments(PEP484):
[[tool.mypy.overrides]]
module = ["tests.test_mac"]
disable_error_code = ["var-annotated"]
[[tool.mypy.overrides]]
module = ["tests.test_ifrename_logic"]
disable_error_code = ["attr-defined", "no-any-return"]
[[tool.mypy.overrides]]
module = ["tests.test_bootloader"]
disable_error_code = ["no-any-return", "union-attr"]
[[tool.mypy.overrides]]
module = ["tests.test_ifrename_logic"]
disable_error_code = ["attr-defined", "no-any-return"]
# Due to special cases for unicode handline in Python2 which are not reached by Python3:
[[tool.mypy.overrides]]
module = ["xcp.bootloader", "xcp.xmlunwrap"]
warn_unreachable = false
[tool.coverage.run]
# The coverage-comment-action needs a .converage file with relative path names:
# https://github.com/py-cov-action/python-coverage-comment-action#setup
relative_files = true
[tool.pyright]
exclude = [
"xcp/cpiofile.py",
"xcp/net/ifrename/logic.py",
"xcp/repository.py",
]
extraPaths = ["stubs"]
include = ["xcp", "tests"]
pythonPlatform = "Linux"
pythonVersion = "3.11"
reportFunctionMemberAccess = true
reportGeneralTypeIssues = "error"
reportOptionalMemberAccess = "error"
reportPrivateUsage = true
reportPropertyTypeMismatch = true
reportUnnecessaryTypeIgnoreComment = false
stubPath = "stubs"
[tool.pytype]
inputs = ["xcp", "tests", "./*.py"]
keepgoing = true
platform = "linux"
python_version = "3.11"
pythonpath = ".:stubs"
disable = ["ignored-type-comment"]
overriding_parameter_count_checks = true
use_enum_overlay = true