xref: /openbmc/qemu/python/README.rst (revision dbe75f55669a4e2295b0dae161b8f796e6dbaded)
1QEMU Python Tooling
2===================
3
4This directory houses Python tooling used by the QEMU project to build,
5configure, and test QEMU. It is organized by namespace (``qemu``), and
6then by package (e.g. ``qemu/machine``, ``qemu/qmp``, etc).
7
8``setup.py`` is used by ``pip`` to install this tooling to the current
9environment. ``setup.cfg`` provides the packaging configuration used by
10``setup.py`` in a setuptools specific format. You will generally invoke
11it by doing one of the following:
12
131. ``pip3 install .`` will install these packages to your current
14   environment. If you are inside a virtual environment, they will
15   install there. If you are not, it will attempt to install to the
16   global environment, which is **not recommended**.
17
182. ``pip3 install --user .`` will install these packages to your user's
19   local python packages. If you are inside of a virtual environment,
20   this will fail; you likely want the first invocation above.
21
22If you append the ``-e`` argument, pip will install in "editable" mode;
23which installs a version of the package that installs a forwarder
24pointing to these files, such that the package always reflects the
25latest version in your git tree.
26
27Installing ".[devel]" instead of "." will additionally pull in required
28packages for testing this package. They are not runtime requirements,
29and are not needed to simply use these libraries.
30
31See `Installing packages using pip and virtual environments
32<https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/>`_
33for more information.
34
35
36Files in this directory
37-----------------------
38
39- ``qemu/`` Python package source directory.
40- ``MANIFEST.in`` is read by python setuptools, it specifies additional files
41  that should be included by a source distribution.
42- ``PACKAGE.rst`` is used as the README file that is visible on PyPI.org.
43- ``Pipfile`` is used by Pipenv to generate ``Pipfile.lock``.
44- ``Pipfile.lock`` is a set of pinned package dependencies that this package
45  is tested under in our CI suite. It is used by ``make venv-check``.
46- ``README.rst`` you are here!
47- ``VERSION`` contains the PEP-440 compliant version used to describe
48  this package; it is referenced by ``setup.cfg``.
49- ``setup.cfg`` houses setuptools package configuration.
50- ``setup.py`` is the setuptools installer used by pip; See above.
51