Re: [packages/python3] - use 'share' not 'lib' for platform independent files - rel 3

2016-04-26 Thread Jacek Konieczny

On 2016-04-26 09:14, Jan Rękorajski wrote:

You are probably breaking pypi and /usr/local installs again!

Proper directories for RPM packages are set with setup.py options via
%py_build/%py_install macros. Packages not using distutils/setuptools may
need patching, but that is better than breaking Python for non-RPM usage.



It caused distutils.sysconfig.get_python_lib() to return /usr/lib for
platform independent modules location which is not what we want and breaks
automake's python.m4.


I am sure I have left this for purpose. Many python packages, including 
'core' ones, like setuptools/pip/virtualenv assume that python_lib is 
${prefix}/lib. Things were quite broken when we patched Python to do 
things 'the right way'.


We only need to force platform independent modules installed in 
/usr/share when building RPM packages and that is mostly solved by our 
%py_build/%py_install macros. The few packages left can always be patched.



That said… I have tested the python3 package after your change to find 
what has been broken… and failed to get the expected results. Either I 
cannot recall the exact thing broken (I have tested various pip and 
virtualenv usage, using upstream packages) or this one change doesn't 
break anything (the 'lib' is hardcoded in a similar way in a few places, 
IIRC).


So it is possible that nothing have been broken in this case, but we 
should be very careful about this.


virtualenv and pip _must_ work properly with unpatched upstream code for 
/usr/local and $HOME installs – that is how lots of Python packages is 
expected to be installed and we are not able to package everything 
ourselves.


Jacek
___
pld-devel-en mailing list
pld-devel-en@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-devel-en


Re: [packages/python3] - use 'share' not 'lib' for platform independent files - rel 3

2016-04-26 Thread Jan Rękorajski
On Mon, Apr 25, 2016 at 10:26 AM, Jacek Konieczny  wrote:

> On 2016-04-23 22:45, baggins wrote:
>
>> commit f69d21534e5f5805751fca202e9e2ae82cb10d35
>> Author: Jan Rękorajski 
>> Date:   Sat Apr 23 22:44:51 2016 +0200
>>
>> - use 'share' not 'lib' for platform independent files
>> - rel 3
>>
>>  python3-multilib.patch | 6 ++
>>  python3.spec   | 2 +-
>>  2 files changed, 3 insertions(+), 5 deletions(-)
>> ---
>> diff --git a/python3.spec b/python3.spec
>> index e89ded1..694d20f 100644
>> --- a/python3.spec
>> +++ b/python3.spec
>> @@ -34,7 +34,7 @@ Summary(tr.UTF-8):X arayüzlü, yüksek düzeyli, kabuk
>> yorumlayıcı dili
>>  Summary(uk.UTF-8): Мова програмування дуже високого рівня з
>> X-інтерфейсом
>>  Name:  python3
>>  Version:   %{py_ver}.1
>> -Release:   2
>> +Release:   3
>>  Epoch: 1
>>  License:   PSF
>>  Group: Development/Languages/Python
>> diff --git a/python3-multilib.patch b/python3-multilib.patch
>> index 30e0e94..f5a49b0 100644
>> --- a/python3-multilib.patch
>> +++ b/python3-multilib.patch
>> @@ -52,7 +52,7 @@ diff -dur Python-3.5.0.orig/Lib/distutils/sysconfig.py
>> Python-3.5.0/Lib/distutil
>>  +if plat_specific:
>>  +lib = sys.lib
>>  +else:
>> -+lib = 'lib'
>> ++lib = 'share'
>>   libpython = os.path.join(prefix,
>>  - "lib", "python" + get_python_version())
>>  + lib, "python" + get_python_version())
>>
>
> You are probably breaking pypi and /usr/local installs again!
>
> Proper directories for RPM packages are set with setup.py options via
> %py_build/%py_install macros. Packages not using distutils/setuptools may
> need patching, but that is better than breaking Python for non-RPM usage.
>

It caused distutils.sysconfig.get_python_lib() to return /usr/lib for
platform independent modules location which is not what we want and breaks
automake's python.m4.

-- 
Jan Rękorajski | SysAdm | PLD/Linux | http://www.pld-linux.org/
bagginspld-linux.org
___
pld-devel-en mailing list
pld-devel-en@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-devel-en