-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathpyproject.toml
218 lines (197 loc) · 6.45 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
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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
[project]
# https://packaging.python.org/en/latest/specifications/declaring-project-metadata/
name = "python-libs"
dynamic = ["version"]
description = "Common Xenserver Python classes"
requires-python = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*"
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 :: 2.7",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"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",
"configparser; python_version < '3.0'",
"pyliblzma; python_version < '3.0'"
]
[project.optional-dependencies]
test = [
"mock",
"pyfakefs",
"pytest<7",
"pytest-cov",
"pytest-forked",
"pytest_httpserver; python_version >= '3.7'",
"pytest-localftpserver; python_version >= '3.7'",
"pytest-localftpserver==0.5.1; python_version <= '3.6'",
"pytest-pythonpath",
"pytest-subprocess; python_version >= '3.6'",
"pytest-timeout",
"typing_extensions"
]
coverage = [
"coverage[toml]",
"diff_cover"
]
mypy = [
"lxml",
"mypy",
"mypy-extensions",
"typing_extensions",
"types-mock",
"types-six",
"types-toml",
]
# pyre introduced two false-postives recently, pin it to prevent further surprises:
pyre = [
"pyre-check == 0.9.21",
"pyre-extensions == 0.0.30",
]
pytype = [
"pandas",
"pytype",
]
tox = [
# The latest versions of tox need 'py>=1.11.0' and this is not stated in the deps of tox-4.5.1.
"py>=1.11.0",
# Use tox==4.5.1: tox>=4 is needed for reading the extras from pyproject.toml
# while tox>=4.5.2 depends on virutalenv>=20.23, which breaks Python 2.7:
"tox==4.5.1; python_version >= '3.7'",
"tox-gh-actions; python_version >= '3.7'",
# virtualenv-20.22 breaks using python2.7 for the `py27` virtualenv with tox and newer
# versions even break py36(which is also EOL) because py36 does not support
# from __future__ import annotations
"virtualenv<20.22",
]
[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.10"
warn_redundant_casts = true
warn_return_any = true
warn_unreachable = true
warn_unused_configs = 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.6"
reportFunctionMemberAccess = true
reportGeneralTypeIssues = "warning"
reportOptionalMemberAccess = "warning"
reportPrivateUsage = true
reportPropertyTypeMismatch = true
reportUnnecessaryTypeIgnoreComment = false
stubPath = "stubs"
[tool.pytype]
inputs = ["xcp", "tests", "./*.py"]
keepgoing = true
platform = "linux"
python_version = "3.10"
pythonpath = ".:stubs"
disable = ["ignored-type-comment"]
overriding_parameter_count_checks = true
use_enum_overlay = true