Re: Python 3 compatibility update to Python guidelines

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

 



On Sat, Oct 17, 2009 at 01:33:29PM +0300, Ville Skyttä wrote:
> https://fedoraproject.org/wiki/Packaging:Python
> 
> %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from 
> distutils.sysconfig import get_python_lib; print get_python_lib()")}
> 
> %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from 
> distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
> 
> 
> These no longer work with Python 3 due to "print" changes.  They should be 
> replaced with something like these that work with both Python 2 and 3 (already 
> done in spectemplate-python.spec in rpmdevtools git):
> 
> %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from 
> distutils.sysconfig import *; import sys; 
> sys.stdout.write(get_python_lib())")}
> 
> %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from 
> distutils.sysconfig import *; import sys; 
> sys.stdout.write(get_python_lib(1))")}
> 
Any reason not to do it this way?

%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from.
distutils.sysconfig import *; print (get_python_lib())")}

%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from.
distutils.sysconfig import *; print(get_python_lib(1))")}

Also, dmalcolm, could we get these macros into the python and python3 (when
revewied) package so we don't have to add them as boilerplate to every
package?

-Toshio

Attachment: pgpudZKj3s5rB.pgp
Description: PGP signature

--
Fedora-packaging mailing list
Fedora-packaging@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-packaging

[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite Forum]     [KDE Users]

  Powered by Linux