qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Making QEMU build with Python 3


From: Stefan Hajnoczi
Subject: [Qemu-devel] Making QEMU build with Python 3
Date: Wed, 9 Aug 2017 11:16:58 +0100

Ross created a bug to track Python 3 support:

  https://bugs.launchpad.net/qemu/+bug/1708462

Currently most Python code in QEMU is for Python 2.6+ only.  There
have only been a few patches adding Python 3 support to certain
scripts so far.

In this email I want to highlight the most important scripts that need
Python 3 support.  Volunteers are welcome!

Python scripts needed to build QEMU are the highest priority.  They
are invoked by ./configure or make.  I've identified the following:

scripts/signrom.py
scripts/qapi*.py
scripts/modules/module_block.py
scripts/tracetool*

Anyone wishing to tackle a script listed here, please reply to this
email thread to avoid duplicating work.

The fundamentals of adding Python 3 support are:

1. The script must work correctly under both Python 2.6+ and Python 3.
Only use language or standard library features that are available in
both Python versions.
2. Compare Python 2.6 vs Python 3 documentation to find a common
subset.  There is often a Pythonic solution that does not require
writing explicit wrappers.
3. Avoid third-party package dependencies - QEMU currently has none!
That means do not use 'six' or 'python-future'.  Our use of Python
isn't that fancy, but if you feel a third party package is essential
the please justify it.
4. If you decide to do PEP8 cleanups, make them separate patches so
review is easy.

Getting started info (but do not rely on 'python-future'):
http://www.python-future.org/compatible_idioms.html

Once the build scripts are converted the next most important group of
Python scripts are the tests.  This is where the bulk of the work
lies.

I have tracetool on my todo list and hope to add Python 3 support in QEMU 2.11.

Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]