xref: /qemu/python/setup.cfg (revision d0394ab5b94c2536603ea804c06201a1f0634c37)
1ea1213b7SJohn Snow[metadata]
2ea1213b7SJohn Snowname = qemu
33afc3290SJohn Snowversion = file:VERSION
4ea1213b7SJohn Snowmaintainer = QEMU Developer Team
5ea1213b7SJohn Snowmaintainer_email = qemu-devel@nongnu.org
6ea1213b7SJohn Snowurl = https://www.qemu.org/
7ea1213b7SJohn Snowdownload_url = https://www.qemu.org/download/
8ea1213b7SJohn Snowdescription = QEMU Python Build, Debug and SDK tooling.
9ea1213b7SJohn Snowlong_description = file:PACKAGE.rst
10ea1213b7SJohn Snowlong_description_content_type = text/x-rst
11ea1213b7SJohn Snowclassifiers =
12ea1213b7SJohn Snow    Development Status :: 3 - Alpha
13ea1213b7SJohn Snow    License :: OSI Approved :: GNU General Public License v2 (GPLv2)
14ea1213b7SJohn Snow    Natural Language :: English
15ea1213b7SJohn Snow    Operating System :: OS Independent
16ea1213b7SJohn Snow    Programming Language :: Python :: 3 :: Only
173c8de38cSJohn Snow    Programming Language :: Python :: 3.9
183c8de38cSJohn Snow    Programming Language :: Python :: 3.10
19519f3cfcSJohn Snow    Programming Language :: Python :: 3.11
2019a39e27SJohn Snow    Programming Language :: Python :: 3.12
2145b14be9SJohn Snow    Programming Language :: Python :: 3.13
227f179082SJohn Snow    Typing :: Typed
23ea1213b7SJohn Snow
24ea1213b7SJohn Snow[options]
25*d64db833SThomas Huthpython_requires = >= 3.9
26ea1213b7SJohn Snowpackages =
2737094b6dSJohn Snow    qemu.qmp
28ea1213b7SJohn Snow    qemu.machine
29ea1213b7SJohn Snow    qemu.utils
30ef42440dSJohn Snow
317f179082SJohn Snow[options.package_data]
327f179082SJohn Snow* = py.typed
337f179082SJohn Snow
34dbe75f55SJohn Snow[options.extras_require]
356832189fSJohn Snow# Remember to update tests/minreqs.txt if changing anything below:
36dbe75f55SJohn Snowdevel =
374320f717SJohn Snow    avocado-framework >= 90.0
38c5538eedSJohn Snow    distlib >= 0.3.6
397b4b98c4SPaolo Bonzini    flake8 >= 5.0.4
40c63f3b0bSJohn Snow    fusepy >= 2.0.4
41dbe75f55SJohn Snow    isort >= 5.1.2
423d7b8974SPaolo Bonzini    mypy >= 1.4.0
437b4b98c4SPaolo Bonzini    pylint >= 2.17.3
44c5be2445SJohn Snow    pylint != 3.2.4; python_version<"3.9"
453c8de38cSJohn Snow    tox >= 3.18.0
46974e2f47SG S Niteesh Babu    urwid >= 2.1.2
47974e2f47SG S Niteesh Babu    urwid-readline >= 0.13
48f37c34d6SG S Niteesh Babu    Pygments >= 2.9.0
49dbe75f55SJohn Snow
50c63f3b0bSJohn Snow# Provides qom-fuse functionality
51c63f3b0bSJohn Snowfuse =
52c63f3b0bSJohn Snow    fusepy >= 2.0.4
53c63f3b0bSJohn Snow
54b1a9b1f7SJohn Snow# QMP TUI dependencies
55974e2f47SG S Niteesh Babutui =
56974e2f47SG S Niteesh Babu    urwid >= 2.1.2
57974e2f47SG S Niteesh Babu    urwid-readline >= 0.13
58f37c34d6SG S Niteesh Babu    Pygments >= 2.9.0
59974e2f47SG S Niteesh Babu
607c4c595fSJohn Snow[options.entry_points]
617c4c595fSJohn Snowconsole_scripts =
620347c4c4SJohn Snow    qom = qemu.utils.qom:main
630347c4c4SJohn Snow    qom-set = qemu.utils.qom:QOMSet.entry_point
640347c4c4SJohn Snow    qom-get = qemu.utils.qom:QOMGet.entry_point
650347c4c4SJohn Snow    qom-list = qemu.utils.qom:QOMList.entry_point
660347c4c4SJohn Snow    qom-tree = qemu.utils.qom:QOMTree.entry_point
670347c4c4SJohn Snow    qom-fuse = qemu.utils.qom_fuse:QOMFuse.entry_point [fuse]
680347c4c4SJohn Snow    qemu-ga-client = qemu.utils.qemu_ga_client:main
6937094b6dSJohn Snow    qmp-shell = qemu.qmp.qmp_shell:main
7037094b6dSJohn Snow    qmp-shell-wrap = qemu.qmp.qmp_shell:main_wrap
71b1a9b1f7SJohn Snow    qmp-tui = qemu.qmp.qmp_tui:main [tui]
727c4c595fSJohn Snow
7381f8c446SJohn Snow[flake8]
74745d58f7SJohn Snow# Prefer pylint's bare-except checks to flake8's
75745d58f7SJohn Snowextend-ignore = E722
7621d0b866SJohn Snowexclude = __pycache__,
7781f8c446SJohn Snow
78e941c844SJohn Snow[mypy]
79e941c844SJohn Snowstrict = True
80*d64db833SThomas Huthpython_version = 3.9
81e941c844SJohn Snowwarn_unused_configs = True
820542a4c9SJohn Snownamespace_packages = True
83e7874a50SJohn Snowwarn_unused_ignores = False
84e941c844SJohn Snow
850347c4c4SJohn Snow[mypy-qemu.utils.qom_fuse]
8630ec845cSJohn Snow# fusepy has no type stubs:
8730ec845cSJohn Snowallow_subclassing_any = True
8830ec845cSJohn Snow
89b1a9b1f7SJohn Snow[mypy-qemu.qmp.qmp_tui]
90aeb6b48aSG S Niteesh Babu# urwid and urwid_readline have no type stubs:
91aeb6b48aSG S Niteesh Babuallow_subclassing_any = True
92aeb6b48aSG S Niteesh Babu
93aeb6b48aSG S Niteesh Babu# The following missing import directives are because these libraries do not
94aeb6b48aSG S Niteesh Babu# provide type stubs. Allow them on an as-needed basis for mypy.
9530ec845cSJohn Snow[mypy-fuse]
96aeb6b48aSG S Niteesh Babuignore_missing_imports = True
97aeb6b48aSG S Niteesh Babu
9871ed611cSPaolo Bonzini[mypy-tomli]
9971ed611cSPaolo Bonziniignore_missing_imports = True
10071ed611cSPaolo Bonzini
10171ed611cSPaolo Bonzini[mypy-tomllib]
10271ed611cSPaolo Bonziniignore_missing_imports = True
10371ed611cSPaolo Bonzini
104aeb6b48aSG S Niteesh Babu[mypy-urwid]
105aeb6b48aSG S Niteesh Babuignore_missing_imports = True
106aeb6b48aSG S Niteesh Babu
107aeb6b48aSG S Niteesh Babu[mypy-urwid_readline]
10830ec845cSJohn Snowignore_missing_imports = True
10930ec845cSJohn Snow
110f37c34d6SG S Niteesh Babu[mypy-pygments]
111f37c34d6SG S Niteesh Babuignore_missing_imports = True
112f37c34d6SG S Niteesh Babu
113c5538eedSJohn Snow[mypy-distlib]
114c5538eedSJohn Snowignore_missing_imports = True
115c5538eedSJohn Snow
11692834894SJohn Snow[mypy-distlib.scripts]
11792834894SJohn Snowignore_missing_imports = True
11892834894SJohn Snow
119c5538eedSJohn Snow[mypy-distlib.version]
120c5538eedSJohn Snowignore_missing_imports = True
121c5538eedSJohn Snow
12268ea6d17SJohn Snow[mypy-pip._vendor.distlib]
12368ea6d17SJohn Snowignore_missing_imports = True
12468ea6d17SJohn Snow
12568ea6d17SJohn Snow[mypy-pip._vendor.distlib.scripts]
12668ea6d17SJohn Snowignore_missing_imports = True
12768ea6d17SJohn Snow
12868ea6d17SJohn Snow[mypy-pip._vendor.distlib.version]
12968ea6d17SJohn Snowignore_missing_imports = True
13068ea6d17SJohn Snow
131ef42440dSJohn Snow[pylint.messages control]
132ef42440dSJohn Snow# Disable the message, report, category or checker with the given id(s). You
133ef42440dSJohn Snow# can either give multiple identifiers separated by comma (,) or put this
134ef42440dSJohn Snow# option multiple times (only on the command line, not in the configuration
135ef42440dSJohn Snow# file where it should appear only once). You can also use "--disable=all" to
136ef42440dSJohn Snow# disable everything first and then reenable specific checks. For example, if
137ef42440dSJohn Snow# you want to run only the similarities checker, you can use "--disable=all
138ef42440dSJohn Snow# --enable=similarities". If you want to run only the classes checker, but have
139ef42440dSJohn Snow# no Warning level messages displayed, use "--disable=all --enable=classes
140ef42440dSJohn Snow# --disable=W".
141eb8033f6SJohn Snowdisable=consider-using-f-string,
1425c66d7d8SDaniel P. Berrangé        consider-using-with,
1435c66d7d8SDaniel P. Berrangé        too-many-arguments,
1444c600fdcSJohn Snow        too-many-positional-arguments,
14529a8ea9bSJohn Snow        too-many-function-args,  # mypy handles this with less false positives.
1465c66d7d8SDaniel P. Berrangé        too-many-instance-attributes,
1474cd17f37SJohn Snow        no-member,  # mypy also handles this better.
148ef42440dSJohn Snow
149ef42440dSJohn Snow[pylint.basic]
150ef42440dSJohn Snow# Good variable names which should always be accepted, separated by a comma.
151ef42440dSJohn Snowgood-names=i,
152ef42440dSJohn Snow           j,
153ef42440dSJohn Snow           k,
154ef42440dSJohn Snow           ex,
155ef42440dSJohn Snow           Run,
156d229f1c8SJohn Snow           _,   # By convention: Unused variable
157d229f1c8SJohn Snow           fh,  # fh = open(...)
158d229f1c8SJohn Snow           fd,  # fd = os.open(...)
159d229f1c8SJohn Snow           c,   # for c in string: ...
16035b9a85aSJohn Snow           T,   # for TypeVars. See pylint#3401
1616c2537d3SJohn Snow           SocketAddrT,  # Not sure why this is invalid.
162ef42440dSJohn Snow
163ef42440dSJohn Snow[pylint.similarities]
164ef42440dSJohn Snow# Ignore imports when computing similarities.
165ef42440dSJohn Snowignore-imports=yes
1665690b437SJohn Snowignore-signatures=yes
167158ac451SJohn Snow
16822305c2aSJohn Snow# Minimum lines number of a similarity.
16922305c2aSJohn Snow# TODO: Remove after we opt in to Pylint 2.8.3. See commit msg.
17022305c2aSJohn Snowmin-similarity-lines=6
17122305c2aSJohn Snow
17222305c2aSJohn Snow
173158ac451SJohn Snow[isort]
174158ac451SJohn Snowforce_grid_wrap=4
175158ac451SJohn Snowforce_sort_within_sections=True
176158ac451SJohn Snowinclude_trailing_comma=True
177158ac451SJohn Snowline_length=72
178158ac451SJohn Snowlines_after_imports=2
179158ac451SJohn Snowmulti_line_output=3
1803c8de38cSJohn Snow
1813c8de38cSJohn Snow# tox (https://tox.readthedocs.io/) is a tool for running tests in
1823c8de38cSJohn Snow# multiple virtualenvs. This configuration file will run the test suite
1833c8de38cSJohn Snow# on all supported python versions. To use it, "pip install tox" and
1843c8de38cSJohn Snow# then run "tox" from this directory. You will need all of these versions
1853c8de38cSJohn Snow# of python available on your system to run this test.
1863c8de38cSJohn Snow
1873c8de38cSJohn Snow[tox:tox]
188*d64db833SThomas Huthenvlist = py39, py310, py311, py312, py313
1896f651a6dSWainer dos Santos Moschettaskip_missing_interpreters = true
1903c8de38cSJohn Snow
1913c8de38cSJohn Snow[testenv]
1923c8de38cSJohn Snowallowlist_externals = make
193c63f3b0bSJohn Snowdeps =
194c63f3b0bSJohn Snow    .[devel]
195c63f3b0bSJohn Snow    .[fuse]  # Workaround to trigger tox venv rebuild
196974e2f47SG S Niteesh Babu    .[tui]   # Workaround to trigger tox venv rebuild
1973c8de38cSJohn Snowcommands =
1983c8de38cSJohn Snow    make check
199a4ffaecdSJohn Snow
200a4ffaecdSJohn Snow# Coverage.py [https://coverage.readthedocs.io/en/latest/] is a tool for
201a4ffaecdSJohn Snow# measuring code coverage of Python programs. It monitors your program,
202a4ffaecdSJohn Snow# noting which parts of the code have been executed, then analyzes the
203a4ffaecdSJohn Snow# source to identify code that could have been executed but was not.
204a4ffaecdSJohn Snow
205a4ffaecdSJohn Snow[coverage:run]
206a4ffaecdSJohn Snowconcurrency = multiprocessing
207a4ffaecdSJohn Snowsource = qemu/
208a4ffaecdSJohn Snowparallel = true
209