python: add qemu package installer
Add setup.cfg and setup.py, necessary for installing a package via
pip. Add a ReST document (PACKAGE.rst) explaining the basics of what
this package is for and who to contact for more information. This
document will be used as the landing page for the package on PyPI.
List the subpackages we intend to package by name instead of using
find_namespace because find_namespace will naively also packages tests,
things it finds in the dist/ folder, etc. I could not figure out how to
modify this behavior; adding allow/deny lists to setuptools kept
changing the packaged hierarchy. This works, roll with it.
I am not yet using a pyproject.toml style package manifest, because
"editable" installs are not defined (yet?) by PEP-517/518.
I consider editable installs crucial for development, though they have
(apparently) always been somewhat poorly defined.
Pip now (19.2 and later) now supports editable installs for projects
using pyproject.toml manifests, but might require the use of the
--no-use-pep517 flag, which somewhat defeats the point. Full support for
setup.py-less editable installs was not introduced until pip 21.1.1:
https://github.com/pypa/pip/pull/9547/commits/7a95720e796a5e56481c1cc20b6ce6249c50f357
For now, while the dust settles, stick with the de-facto
setup.py/setup.cfg combination supported by setuptools. It will be worth
re-evaluating this point again in the future when our supported build
platforms all ship a fairly modern pip.
Additional reading on this matter:
https://github.com/pypa/packaging-problems/issues/256
https://github.com/pypa/pip/issues/6334
https://github.com/pypa/pip/issues/6375
https://github.com/pypa/pip/issues/6434
https://github.com/pypa/pip/issues/6438
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Cleber Rosa <crosa@redhat.com>
Message-id: 20210527211715.394144-11-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
2021-05-27 23:16:54 +02:00
|
|
|
[metadata]
|
|
|
|
name = qemu
|
python: add VERSION file
Python infrastructure as it exists today is not capable reliably of
single-sourcing a package version from a parent directory. The authors
of pip are working to correct this, but as of today this is not possible.
The problem is that when using pip to build and install a python
package, it copies files over to a temporary directory and performs its
build there. This loses access to any information in the parent
directory, including git itself.
Further, Python versions have a standard (PEP 440) that may or may not
follow QEMU's versioning. In general, it does; but naturally QEMU does
not follow PEP 440. To avoid any automatically-generated conflict, a
manual version file is preferred.
I am proposing:
- Python tooling follows the QEMU version, indirectly, but with a major
version of 0 to indicate that the API is not expected to be
stable. This would mean version 0.5.2.0, 0.5.1.1, 0.5.3.0, etc.
- In the event that a Python package needs to be updated independently
of the QEMU version, a pre-release alpha version should be preferred,
but *only* after inclusion to the qemu development or stable branches.
e.g. 0.5.2.0a1, 0.5.2.0a2, and so on should be preferred prior to
5.2.0's release.
- The Python core tooling makes absolutely no version compatibility
checks or constraints. It *may* work with releases of QEMU from the
past or future, but it is not required to.
i.e., "qemu.machine" will, for now, remain in lock-step with QEMU.
- We reserve the right to split the qemu package into independently
versioned subpackages at a later date. This might allow for us to
begin versioning QMP independently from QEMU at a later date, if
we so choose.
Implement this versioning scheme by adding a VERSION file and setting it
to 0.6.0.0a1.
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Cleber Rosa <crosa@redhat.com>
Message-id: 20210527211715.394144-12-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
2021-05-27 23:16:55 +02:00
|
|
|
version = file:VERSION
|
python: add qemu package installer
Add setup.cfg and setup.py, necessary for installing a package via
pip. Add a ReST document (PACKAGE.rst) explaining the basics of what
this package is for and who to contact for more information. This
document will be used as the landing page for the package on PyPI.
List the subpackages we intend to package by name instead of using
find_namespace because find_namespace will naively also packages tests,
things it finds in the dist/ folder, etc. I could not figure out how to
modify this behavior; adding allow/deny lists to setuptools kept
changing the packaged hierarchy. This works, roll with it.
I am not yet using a pyproject.toml style package manifest, because
"editable" installs are not defined (yet?) by PEP-517/518.
I consider editable installs crucial for development, though they have
(apparently) always been somewhat poorly defined.
Pip now (19.2 and later) now supports editable installs for projects
using pyproject.toml manifests, but might require the use of the
--no-use-pep517 flag, which somewhat defeats the point. Full support for
setup.py-less editable installs was not introduced until pip 21.1.1:
https://github.com/pypa/pip/pull/9547/commits/7a95720e796a5e56481c1cc20b6ce6249c50f357
For now, while the dust settles, stick with the de-facto
setup.py/setup.cfg combination supported by setuptools. It will be worth
re-evaluating this point again in the future when our supported build
platforms all ship a fairly modern pip.
Additional reading on this matter:
https://github.com/pypa/packaging-problems/issues/256
https://github.com/pypa/pip/issues/6334
https://github.com/pypa/pip/issues/6375
https://github.com/pypa/pip/issues/6434
https://github.com/pypa/pip/issues/6438
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Cleber Rosa <crosa@redhat.com>
Message-id: 20210527211715.394144-11-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
2021-05-27 23:16:54 +02:00
|
|
|
maintainer = QEMU Developer Team
|
|
|
|
maintainer_email = qemu-devel@nongnu.org
|
|
|
|
url = https://www.qemu.org/
|
|
|
|
download_url = https://www.qemu.org/download/
|
|
|
|
description = QEMU Python Build, Debug and SDK tooling.
|
|
|
|
long_description = file:PACKAGE.rst
|
|
|
|
long_description_content_type = text/x-rst
|
|
|
|
classifiers =
|
|
|
|
Development Status :: 3 - Alpha
|
|
|
|
License :: OSI Approved :: GNU General Public License v2 (GPLv2)
|
|
|
|
Natural Language :: English
|
|
|
|
Operating System :: OS Independent
|
|
|
|
Programming Language :: Python :: 3 :: Only
|
2021-05-27 23:17:14 +02:00
|
|
|
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
|
2021-06-29 23:43:10 +02:00
|
|
|
Typing :: Typed
|
python: add qemu package installer
Add setup.cfg and setup.py, necessary for installing a package via
pip. Add a ReST document (PACKAGE.rst) explaining the basics of what
this package is for and who to contact for more information. This
document will be used as the landing page for the package on PyPI.
List the subpackages we intend to package by name instead of using
find_namespace because find_namespace will naively also packages tests,
things it finds in the dist/ folder, etc. I could not figure out how to
modify this behavior; adding allow/deny lists to setuptools kept
changing the packaged hierarchy. This works, roll with it.
I am not yet using a pyproject.toml style package manifest, because
"editable" installs are not defined (yet?) by PEP-517/518.
I consider editable installs crucial for development, though they have
(apparently) always been somewhat poorly defined.
Pip now (19.2 and later) now supports editable installs for projects
using pyproject.toml manifests, but might require the use of the
--no-use-pep517 flag, which somewhat defeats the point. Full support for
setup.py-less editable installs was not introduced until pip 21.1.1:
https://github.com/pypa/pip/pull/9547/commits/7a95720e796a5e56481c1cc20b6ce6249c50f357
For now, while the dust settles, stick with the de-facto
setup.py/setup.cfg combination supported by setuptools. It will be worth
re-evaluating this point again in the future when our supported build
platforms all ship a fairly modern pip.
Additional reading on this matter:
https://github.com/pypa/packaging-problems/issues/256
https://github.com/pypa/pip/issues/6334
https://github.com/pypa/pip/issues/6375
https://github.com/pypa/pip/issues/6434
https://github.com/pypa/pip/issues/6438
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Cleber Rosa <crosa@redhat.com>
Message-id: 20210527211715.394144-11-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
2021-05-27 23:16:54 +02:00
|
|
|
|
|
|
|
[options]
|
|
|
|
python_requires = >= 3.6
|
|
|
|
packages =
|
|
|
|
qemu.qmp
|
|
|
|
qemu.machine
|
|
|
|
qemu.utils
|
2021-09-15 18:29:29 +02:00
|
|
|
qemu.aqmp
|
2021-05-27 23:17:00 +02:00
|
|
|
|
2021-06-29 23:43:10 +02:00
|
|
|
[options.package_data]
|
|
|
|
* = py.typed
|
|
|
|
|
2021-05-27 23:17:10 +02:00
|
|
|
[options.extras_require]
|
2021-06-29 23:43:12 +02:00
|
|
|
# For the devel group, When adding new dependencies or bumping the minimum
|
|
|
|
# version, use e.g. "pipenv install --dev pylint==3.0.0".
|
|
|
|
# Subsequently, edit 'Pipfile' to remove e.g. 'pylint = "==3.0.0'.
|
2021-05-27 23:17:10 +02:00
|
|
|
devel =
|
2021-09-15 18:29:52 +02:00
|
|
|
avocado-framework >= 90.0
|
2021-05-27 23:17:10 +02:00
|
|
|
flake8 >= 3.6.0
|
2021-06-03 02:37:16 +02:00
|
|
|
fusepy >= 2.0.4
|
2021-05-27 23:17:10 +02:00
|
|
|
isort >= 5.1.2
|
|
|
|
mypy >= 0.770
|
|
|
|
pylint >= 2.8.0
|
2021-05-27 23:17:14 +02:00
|
|
|
tox >= 3.18.0
|
2021-08-24 00:07:42 +02:00
|
|
|
urwid >= 2.1.2
|
|
|
|
urwid-readline >= 0.13
|
2021-08-24 00:07:45 +02:00
|
|
|
Pygments >= 2.9.0
|
2021-05-27 23:17:10 +02:00
|
|
|
|
2021-06-03 02:37:16 +02:00
|
|
|
# Provides qom-fuse functionality
|
|
|
|
fuse =
|
|
|
|
fusepy >= 2.0.4
|
|
|
|
|
2021-08-24 00:07:42 +02:00
|
|
|
# AQMP TUI dependencies
|
|
|
|
tui =
|
|
|
|
urwid >= 2.1.2
|
|
|
|
urwid-readline >= 0.13
|
2021-08-24 00:07:45 +02:00
|
|
|
Pygments >= 2.9.0
|
2021-08-24 00:07:42 +02:00
|
|
|
|
2021-06-03 02:37:05 +02:00
|
|
|
[options.entry_points]
|
|
|
|
console_scripts =
|
|
|
|
qom = qemu.qmp.qom:main
|
|
|
|
qom-set = qemu.qmp.qom:QOMSet.entry_point
|
|
|
|
qom-get = qemu.qmp.qom:QOMGet.entry_point
|
|
|
|
qom-list = qemu.qmp.qom:QOMList.entry_point
|
|
|
|
qom-tree = qemu.qmp.qom:QOMTree.entry_point
|
2021-06-03 02:37:19 +02:00
|
|
|
qom-fuse = qemu.qmp.qom_fuse:QOMFuse.entry_point [fuse]
|
2021-06-04 17:55:31 +02:00
|
|
|
qemu-ga-client = qemu.qmp.qemu_ga_client:main
|
2021-06-07 22:06:48 +02:00
|
|
|
qmp-shell = qemu.qmp.qmp_shell:main
|
2021-08-24 00:07:44 +02:00
|
|
|
aqmp-tui = qemu.aqmp.aqmp_tui:main [tui]
|
2021-06-03 02:37:05 +02:00
|
|
|
|
2021-05-27 23:17:02 +02:00
|
|
|
[flake8]
|
|
|
|
extend-ignore = E722 # Prefer pylint's bare-except checks to flake8's
|
2021-05-27 23:17:03 +02:00
|
|
|
exclude = __pycache__,
|
2021-05-27 23:17:02 +02:00
|
|
|
|
2021-05-27 23:17:05 +02:00
|
|
|
[mypy]
|
|
|
|
strict = True
|
|
|
|
python_version = 3.6
|
|
|
|
warn_unused_configs = True
|
2021-05-27 23:17:06 +02:00
|
|
|
namespace_packages = True
|
2021-05-27 23:17:05 +02:00
|
|
|
|
2021-06-03 02:37:15 +02:00
|
|
|
[mypy-qemu.qmp.qom_fuse]
|
|
|
|
# fusepy has no type stubs:
|
|
|
|
allow_subclassing_any = True
|
|
|
|
|
2021-08-24 00:07:43 +02:00
|
|
|
[mypy-qemu.aqmp.aqmp_tui]
|
|
|
|
# urwid and urwid_readline have no type stubs:
|
|
|
|
allow_subclassing_any = True
|
|
|
|
|
|
|
|
# The following missing import directives are because these libraries do not
|
|
|
|
# provide type stubs. Allow them on an as-needed basis for mypy.
|
2021-06-03 02:37:15 +02:00
|
|
|
[mypy-fuse]
|
2021-08-24 00:07:43 +02:00
|
|
|
ignore_missing_imports = True
|
|
|
|
|
|
|
|
[mypy-urwid]
|
|
|
|
ignore_missing_imports = True
|
|
|
|
|
|
|
|
[mypy-urwid_readline]
|
2021-06-03 02:37:15 +02:00
|
|
|
ignore_missing_imports = True
|
|
|
|
|
2021-08-24 00:07:45 +02:00
|
|
|
[mypy-pygments]
|
|
|
|
ignore_missing_imports = True
|
|
|
|
|
2021-05-27 23:17:00 +02:00
|
|
|
[pylint.messages control]
|
|
|
|
# Disable the message, report, category or checker with the given id(s). You
|
|
|
|
# can either give multiple identifiers separated by comma (,) or put this
|
|
|
|
# option multiple times (only on the command line, not in the configuration
|
|
|
|
# file where it should appear only once). You can also use "--disable=all" to
|
|
|
|
# disable everything first and then reenable specific checks. For example, if
|
|
|
|
# you want to run only the similarities checker, you can use "--disable=all
|
|
|
|
# --enable=similarities". If you want to run only the classes checker, but have
|
|
|
|
# no Warning level messages displayed, use "--disable=all --enable=classes
|
|
|
|
# --disable=W".
|
2021-09-16 20:22:48 +02:00
|
|
|
disable=consider-using-f-string,
|
2021-09-15 18:29:44 +02:00
|
|
|
too-many-function-args, # mypy handles this with less false positives.
|
2021-09-15 18:29:46 +02:00
|
|
|
no-member, # mypy also handles this better.
|
2021-05-27 23:17:00 +02:00
|
|
|
|
|
|
|
[pylint.basic]
|
|
|
|
# Good variable names which should always be accepted, separated by a comma.
|
|
|
|
good-names=i,
|
|
|
|
j,
|
|
|
|
k,
|
|
|
|
ex,
|
|
|
|
Run,
|
2021-06-03 02:37:09 +02:00
|
|
|
_, # By convention: Unused variable
|
|
|
|
fh, # fh = open(...)
|
|
|
|
fd, # fd = os.open(...)
|
|
|
|
c, # for c in string: ...
|
2021-09-15 18:29:31 +02:00
|
|
|
T, # for TypeVars. See pylint#3401
|
2021-05-27 23:17:00 +02:00
|
|
|
|
|
|
|
[pylint.similarities]
|
|
|
|
# Ignore imports when computing similarities.
|
|
|
|
ignore-imports=yes
|
2021-09-16 20:22:47 +02:00
|
|
|
ignore-signatures=yes
|
2021-05-27 23:17:07 +02:00
|
|
|
|
2021-08-09 11:01:00 +02:00
|
|
|
# Minimum lines number of a similarity.
|
|
|
|
# TODO: Remove after we opt in to Pylint 2.8.3. See commit msg.
|
|
|
|
min-similarity-lines=6
|
|
|
|
|
|
|
|
|
2021-05-27 23:17:07 +02:00
|
|
|
[isort]
|
|
|
|
force_grid_wrap=4
|
|
|
|
force_sort_within_sections=True
|
|
|
|
include_trailing_comma=True
|
|
|
|
line_length=72
|
|
|
|
lines_after_imports=2
|
|
|
|
multi_line_output=3
|
2021-05-27 23:17:14 +02:00
|
|
|
|
|
|
|
# tox (https://tox.readthedocs.io/) is a tool for running tests in
|
|
|
|
# multiple virtualenvs. This configuration file will run the test suite
|
|
|
|
# on all supported python versions. To use it, "pip install tox" and
|
|
|
|
# then run "tox" from this directory. You will need all of these versions
|
|
|
|
# of python available on your system to run this test.
|
|
|
|
|
|
|
|
[tox:tox]
|
|
|
|
envlist = py36, py37, py38, py39, py310
|
2021-06-30 20:45:46 +02:00
|
|
|
skip_missing_interpreters = true
|
2021-05-27 23:17:14 +02:00
|
|
|
|
|
|
|
[testenv]
|
|
|
|
allowlist_externals = make
|
2021-06-03 02:37:16 +02:00
|
|
|
deps =
|
|
|
|
.[devel]
|
|
|
|
.[fuse] # Workaround to trigger tox venv rebuild
|
2021-08-24 00:07:42 +02:00
|
|
|
.[tui] # Workaround to trigger tox venv rebuild
|
2021-05-27 23:17:14 +02:00
|
|
|
commands =
|
|
|
|
make check
|
2021-09-15 18:29:55 +02:00
|
|
|
|
|
|
|
# Coverage.py [https://coverage.readthedocs.io/en/latest/] is a tool for
|
|
|
|
# measuring code coverage of Python programs. It monitors your program,
|
|
|
|
# noting which parts of the code have been executed, then analyzes the
|
|
|
|
# source to identify code that could have been executed but was not.
|
|
|
|
|
|
|
|
[coverage:run]
|
|
|
|
concurrency = multiprocessing
|
|
|
|
source = qemu/
|
|
|
|
parallel = true
|