xref: /qemu/python/setup.cfg (revision c01196bd)
1[metadata]
2name = qemu
3version = file:VERSION
4maintainer = QEMU Developer Team
5maintainer_email = qemu-devel@nongnu.org
6url = https://www.qemu.org/
7download_url = https://www.qemu.org/download/
8description = QEMU Python Build, Debug and SDK tooling.
9long_description = file:PACKAGE.rst
10long_description_content_type = text/x-rst
11classifiers =
12    Development Status :: 3 - Alpha
13    License :: OSI Approved :: GNU General Public License v2 (GPLv2)
14    Natural Language :: English
15    Operating System :: OS Independent
16    Programming Language :: Python :: 3 :: Only
17    Programming Language :: Python :: 3.7
18    Programming Language :: Python :: 3.8
19    Programming Language :: Python :: 3.9
20    Programming Language :: Python :: 3.10
21    Programming Language :: Python :: 3.11
22    Typing :: Typed
23
24[options]
25python_requires = >= 3.7
26packages =
27    qemu.qmp
28    qemu.machine
29    qemu.utils
30
31[options.package_data]
32* = py.typed
33
34[options.extras_require]
35# Remember to update tests/minreqs.txt if changing anything below:
36devel =
37    avocado-framework >= 90.0
38    distlib >= 0.3.6
39    flake8 >= 5.0.4
40    fusepy >= 2.0.4
41    isort >= 5.1.2
42    mypy >= 1.4.0
43    pylint >= 2.17.3
44    tox >= 3.18.0
45    urwid >= 2.1.2
46    urwid-readline >= 0.13
47    Pygments >= 2.9.0
48
49# Provides qom-fuse functionality
50fuse =
51    fusepy >= 2.0.4
52
53# QMP TUI dependencies
54tui =
55    urwid >= 2.1.2
56    urwid-readline >= 0.13
57    Pygments >= 2.9.0
58
59[options.entry_points]
60console_scripts =
61    qom = qemu.utils.qom:main
62    qom-set = qemu.utils.qom:QOMSet.entry_point
63    qom-get = qemu.utils.qom:QOMGet.entry_point
64    qom-list = qemu.utils.qom:QOMList.entry_point
65    qom-tree = qemu.utils.qom:QOMTree.entry_point
66    qom-fuse = qemu.utils.qom_fuse:QOMFuse.entry_point [fuse]
67    qemu-ga-client = qemu.utils.qemu_ga_client:main
68    qmp-shell = qemu.qmp.qmp_shell:main
69    qmp-shell-wrap = qemu.qmp.qmp_shell:main_wrap
70    qmp-tui = qemu.qmp.qmp_tui:main [tui]
71
72[flake8]
73# Prefer pylint's bare-except checks to flake8's
74extend-ignore = E722
75exclude = __pycache__,
76
77[mypy]
78strict = True
79python_version = 3.7
80warn_unused_configs = True
81namespace_packages = True
82warn_unused_ignores = False
83
84[mypy-qemu.utils.qom_fuse]
85# fusepy has no type stubs:
86allow_subclassing_any = True
87
88[mypy-qemu.qmp.qmp_tui]
89# urwid and urwid_readline have no type stubs:
90allow_subclassing_any = True
91
92# The following missing import directives are because these libraries do not
93# provide type stubs. Allow them on an as-needed basis for mypy.
94[mypy-fuse]
95ignore_missing_imports = True
96
97[mypy-tomli]
98ignore_missing_imports = True
99
100[mypy-tomllib]
101ignore_missing_imports = True
102
103[mypy-urwid]
104ignore_missing_imports = True
105
106[mypy-urwid_readline]
107ignore_missing_imports = True
108
109[mypy-pygments]
110ignore_missing_imports = True
111
112[mypy-importlib.metadata]
113ignore_missing_imports = True
114
115[mypy-importlib_metadata]
116ignore_missing_imports = True
117
118[mypy-pkg_resources]
119ignore_missing_imports = True
120
121[mypy-distlib]
122ignore_missing_imports = True
123
124[mypy-distlib.scripts]
125ignore_missing_imports = True
126
127[mypy-distlib.version]
128ignore_missing_imports = True
129
130[mypy-pip._vendor.distlib]
131ignore_missing_imports = True
132
133[mypy-pip._vendor.distlib.scripts]
134ignore_missing_imports = True
135
136[mypy-pip._vendor.distlib.version]
137ignore_missing_imports = True
138
139[pylint.messages control]
140# Disable the message, report, category or checker with the given id(s). You
141# can either give multiple identifiers separated by comma (,) or put this
142# option multiple times (only on the command line, not in the configuration
143# file where it should appear only once). You can also use "--disable=all" to
144# disable everything first and then reenable specific checks. For example, if
145# you want to run only the similarities checker, you can use "--disable=all
146# --enable=similarities". If you want to run only the classes checker, but have
147# no Warning level messages displayed, use "--disable=all --enable=classes
148# --disable=W".
149disable=consider-using-f-string,
150        consider-using-with,
151        too-many-arguments,
152        too-many-function-args,  # mypy handles this with less false positives.
153        too-many-instance-attributes,
154        no-member,  # mypy also handles this better.
155
156[pylint.basic]
157# Good variable names which should always be accepted, separated by a comma.
158good-names=i,
159           j,
160           k,
161           ex,
162           Run,
163           _,   # By convention: Unused variable
164           fh,  # fh = open(...)
165           fd,  # fd = os.open(...)
166           c,   # for c in string: ...
167           T,   # for TypeVars. See pylint#3401
168           SocketAddrT,  # Not sure why this is invalid.
169
170[pylint.similarities]
171# Ignore imports when computing similarities.
172ignore-imports=yes
173ignore-signatures=yes
174
175# Minimum lines number of a similarity.
176# TODO: Remove after we opt in to Pylint 2.8.3. See commit msg.
177min-similarity-lines=6
178
179
180[isort]
181force_grid_wrap=4
182force_sort_within_sections=True
183include_trailing_comma=True
184line_length=72
185lines_after_imports=2
186multi_line_output=3
187
188# tox (https://tox.readthedocs.io/) is a tool for running tests in
189# multiple virtualenvs. This configuration file will run the test suite
190# on all supported python versions. To use it, "pip install tox" and
191# then run "tox" from this directory. You will need all of these versions
192# of python available on your system to run this test.
193
194[tox:tox]
195envlist = py37, py38, py39, py310, py311
196skip_missing_interpreters = true
197
198[testenv]
199allowlist_externals = make
200deps =
201    .[devel]
202    .[fuse]  # Workaround to trigger tox venv rebuild
203    .[tui]   # Workaround to trigger tox venv rebuild
204commands =
205    make check
206
207# Coverage.py [https://coverage.readthedocs.io/en/latest/] is a tool for
208# measuring code coverage of Python programs. It monitors your program,
209# noting which parts of the code have been executed, then analyzes the
210# source to identify code that could have been executed but was not.
211
212[coverage:run]
213concurrency = multiprocessing
214source = qemu/
215parallel = true
216