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: Wed, 3 Jun 2020 10:09:41 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0


On 6/3/20 5:00 AM, Kevin Wolf wrote:
> Am 02.06.2020 um 18:44 hat John Snow geschrieben:
>>
>>
>> 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.)
> 
> I'm just running 297, so if this is how mypy should be called now, the
> series needs to make a change to 297.
> 
> Kevin
> 

Yes, sorry -- 297 wasn't merged yet when I wrote the 32 patch RFC, and
my followup series to add mypy support is now factored to occur prior to
the library split.

I have corrected this in the more recent postings, sorry for the
inconvenience.




reply via email to

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