[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 02/25] python: create qemu packages
From: |
Willian Rampazzo |
Subject: |
Re: [PATCH v6 02/25] python: create qemu packages |
Date: |
Fri, 21 May 2021 14:15:30 -0300 |
On Wed, May 12, 2021 at 8:13 PM John Snow <jsnow@redhat.com> wrote:
>
> move python/qemu/*.py to python/qemu/[machine, qmp]/*.py and update import
> directives across the tree.
>
> This is done to create a PEP420 namespace package, in which we may
> create subpackages. To do this, the namespace directory ("qemu") should
> not have any modules in it. Those files will go into new 'machine' and 'qmp'
> subpackages instead.
>
> Implement machine/__init__.py making the top-level classes and functions
> from its various modules available directly inside the package. Change
> qmp.py to qmp/__init__.py similarly, such that all of the useful QMP
> library classes are available directly from "qemu.qmp" instead of
> "qemu.qmp.qmp".
>
> Signed-off-by: John Snow <jsnow@redhat.com>
>
>
> ---
>
> Note for reviewers: in the next patch, I add a utils sub-package and
> move qemu/machine/accel.py to qemu/utils/accel.py. If we like it that
> way, we can squash it in here if we want, or just leave it as its own
> follow-up patch, I am just leaving it as something that will be easy to
> un-do or change for now.
>
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
> python/{qemu => }/.isort.cfg | 0
> python/qemu/__init__.py | 11 ------
> python/qemu/{ => machine}/.flake8 | 0
> python/qemu/machine/__init__.py | 41 +++++++++++++++++++++
> python/qemu/{ => machine}/accel.py | 0
> python/qemu/{ => machine}/console_socket.py | 0
> python/qemu/{ => machine}/machine.py | 16 +++++---
> python/qemu/{ => machine}/pylintrc | 0
> python/qemu/{ => machine}/qtest.py | 3 +-
> python/qemu/{qmp.py => qmp/__init__.py} | 12 +++++-
> tests/acceptance/avocado_qemu/__init__.py | 4 +-
> tests/acceptance/virtio-gpu.py | 2 +-
> tests/qemu-iotests/300 | 4 +-
> tests/qemu-iotests/iotests.py | 2 +-
> tests/vm/aarch64vm.py | 2 +-
> tests/vm/basevm.py | 3 +-
> 16 files changed, 73 insertions(+), 27 deletions(-)
> rename python/{qemu => }/.isort.cfg (100%)
> delete mode 100644 python/qemu/__init__.py
> rename python/qemu/{ => machine}/.flake8 (100%)
> create mode 100644 python/qemu/machine/__init__.py
> rename python/qemu/{ => machine}/accel.py (100%)
> rename python/qemu/{ => machine}/console_socket.py (100%)
> rename python/qemu/{ => machine}/machine.py (98%)
> rename python/qemu/{ => machine}/pylintrc (100%)
> rename python/qemu/{ => machine}/qtest.py (99%)
> rename python/qemu/{qmp.py => qmp/__init__.py} (96%)
>
This improves a lot the organization of the code.
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
- [PATCH v6 00/25] python: create installable package, John Snow, 2021/05/12
- [PATCH v6 01/25] iotests/297: add --namespace-packages to mypy arguments, John Snow, 2021/05/12
- [PATCH v6 03/25] python: create utils sub-package, John Snow, 2021/05/12
- [PATCH v6 02/25] python: create qemu packages, John Snow, 2021/05/12
- [PATCH v6 04/25] python: add qemu package installer, John Snow, 2021/05/12
- [PATCH v6 05/25] python: add VERSION file, John Snow, 2021/05/12
- [PATCH v6 07/25] python: add MANIFEST.in, John Snow, 2021/05/12
- [PATCH v6 06/25] python: add directory structure README.rst files, John Snow, 2021/05/12