qemu-block
[Top][All Lists]
Advanced

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

Re: [PATCH RFC 01/32] python/qemu: create qemu.lib module


From: John Snow
Subject: Re: [PATCH RFC 01/32] python/qemu: create qemu.lib module
Date: Tue, 2 Jun 2020 12:44:03 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0


On 6/2/20 6:08 AM, Kevin Wolf wrote:
> Am 14.05.2020 um 07:53 hat John Snow geschrieben:
>> move python/qemu/*.py to python/qemu/lib/*.py.
>>
>> To create a namespace package, the 'qemu' directory itself shouldn't
>> have module files in it. Thus, these files will go under a 'lib' package
>> directory instead.
>>
>> Bolster the lib/__init__.py file a little bit, Make the top-level
>> classes and functions available directly inside the `qemu.lib`
>> namespace, to facilitate a convenient shorthand:
>>
>>> from qemu.lib import QEMUQtestMachine, QEMUMonitorProtocol
>>
>> Lastly, update all of the existing import directives.
>>
>> (Note: these scripts were not necessarily tested to see if they still
>> work. Some of these scripts are in obvious states of disrepair and it is
>> beyond the scope of this patch to attempt to fix them.)
>>
>> Signed-off-by: John Snow <jsnow@redhat.com>
>> ---
>>  python/qemu/__init__.py                   | 11 -----
> 
> When trying to reproduce your mypy problem, I was wondering why mypy was
> complaining that it couldn't find qemu.lib. The reason is that removing
> __init__.py from qemu means it's not a valid module any more. If I
> recreate it locally, mypy stops complaining.
> 
> So I think we need to leave this file here.
> 
> Kevin
> 

Depends. You'll want --namespace-packages to parse a PEP420 namespace.

(It's not a given we definitely want a PEP420 namespace, but that's what
I created here.)

--js




reply via email to

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