[Fedora-packaging] Python 3 compatibility update to Python guidelines
Toshio Kuratomi
a.badger at gmail.com
Sat Oct 31 01:48:54 UTC 2009
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-packaging/attachments/20091030/80b85292/attachment.sig>
More information about the Fedora-packaging
mailing list