xref: /openbmc/qemu/python/README.rst (revision 719f0f60)
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
31Running ``make develop`` will pull in all testing dependencies and
32install QEMU in editable mode to the current environment.
33
34See `Installing packages using pip and virtual environments
35<https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/>`_
36for more information.
37
38
39Files in this directory
40-----------------------
41
42- ``qemu/`` Python package source directory.
43- ``tests/`` Python package tests directory.
44- ``avocado.cfg`` Configuration for the Avocado test-runner.
45  Used by ``make check`` et al.
46- ``Makefile`` provides some common testing/installation invocations.
47  Try ``make help`` to see available targets.
48- ``MANIFEST.in`` is read by python setuptools, it specifies additional files
49  that should be included by a source distribution.
50- ``PACKAGE.rst`` is used as the README file that is visible on PyPI.org.
51- ``Pipfile`` is used by Pipenv to generate ``Pipfile.lock``.
52- ``Pipfile.lock`` is a set of pinned package dependencies that this package
53  is tested under in our CI suite. It is used by ``make venv-check``.
54- ``README.rst`` you are here!
55- ``VERSION`` contains the PEP-440 compliant version used to describe
56  this package; it is referenced by ``setup.cfg``.
57- ``setup.cfg`` houses setuptools package configuration.
58- ``setup.py`` is the setuptools installer used by pip; See above.
59