[Kimchi-devel] [PATCH] packaging: ship kimchi with plugins/__init__.py

Zhou Zheng Sheng zhshzhou at linux.vnet.ibm.com
Tue Apr 22 06:44:13 UTC 2014


Hi Aline,

Mark Wu has reviewed this patch. I think this patch fixes a packaging
problem in Kimchi. We should ship plugins/__init__.py in the RPM so that
Python imports installed plugins correctly. If you have time maybe you
can take a look.

on 2014/04/17 15:30, Mark Wu wrote:
> On 04/17/2014 11:59 AM, zhshzhou at linux.vnet.ibm.com wrote:
>> From: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
>>
>> If we do not package and install plugins/__init__.py, plugins can not be
>> imported as "import kimchi.plugins.pluginXYZ". The plugins also can not
>> be discovered and imported dynamically. This patch fixes the problem.
>>
>> Signed-off-by: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
>> ---
>>   contrib/kimchi.spec.fedora.in | 1 +
>>   contrib/kimchi.spec.suse.in   | 1 +
>>   plugins/Makefile.am           | 5 ++++-
>>   3 files changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/contrib/kimchi.spec.fedora.in
>> b/contrib/kimchi.spec.fedora.in
>> index 1cd99b0..62d3000 100644
>> --- a/contrib/kimchi.spec.fedora.in
>> +++ b/contrib/kimchi.spec.fedora.in
>> @@ -141,6 +141,7 @@ rm -rf $RPM_BUILD_ROOT
>>   %{python_sitelib}/kimchi/control/vm/*.py*
>>   %{python_sitelib}/kimchi/model/*.py*
>>   %{python_sitelib}/kimchi/API.json
>> +%{python_sitelib}/kimchi/plugins/*.py*
>>   %{_datadir}/kimchi/doc/API.md
>>   %{_datadir}/kimchi/doc/README.md
>>   %{_datadir}/kimchi/doc/kimchi-guest.png
>> diff --git a/contrib/kimchi.spec.suse.in b/contrib/kimchi.spec.suse.in
>> index efb2c08..524a000 100644
>> --- a/contrib/kimchi.spec.suse.in
>> +++ b/contrib/kimchi.spec.suse.in
>> @@ -67,6 +67,7 @@ rm -rf $RPM_BUILD_ROOT
>>   %{python_sitelib}/kimchi/control/vm/*.py*
>>   %{python_sitelib}/kimchi/model/*.py*
>>   %{python_sitelib}/kimchi/API.json
>> +%{python_sitelib}/kimchi/plugins/*.py*
>>   %{_datadir}/kimchi/doc/API.md
>>   %{_datadir}/kimchi/doc/README.md
>>   %{_datadir}/kimchi/doc/kimchi-guest.png
>> diff --git a/plugins/Makefile.am b/plugins/Makefile.am
>> index 2ceedae..894d28e 100644
>> --- a/plugins/Makefile.am
>> +++ b/plugins/Makefile.am
>> @@ -19,4 +19,7 @@
>>
>>   SUBDIRS = sample
>>
>> -EXTRA_DIST = __init__.py
>> +plugins_PYTHON = \
>> +    __init__.py
>> +
>> +pluginsdir = $(pythondir)/kimchi/plugins
> Reviewed-by: Mark Wu<wudxw at linux.vnet.ibm.com>
> 
> It makes sense to provide the plugin mechanism support in kimchi base.


-- 
Thanks and best regards!

Zhou Zheng Sheng / 周征晟
E-mail: zhshzhou at linux.vnet.ibm.com
Telephone: 86-10-82454397




More information about the Kimchi-devel mailing list