[Distutils] I need to create a customized Fedora live cd with Python applications on it
Phillip J. Eby
pje at telecommunity.com
Tue May 29 21:43:37 CEST 2007
At 02:10 PM 5/29/2007 -0400, Stanley A. Klein wrote:
>I found a report on bugzilla.redhat.com, "Bug 236535 Processed:
>brp-python-bytecompile does not work with bdist-rpm target" and am cc:'ing
>the cc: list for that bug on this email.
>
>I posted a comment to that bug strongly urging the Fedora packaging people
>and the Python packaging people to get their heads together and resolve
>this issue.
>
>For the benefit of the people on the Fedora bug cc: list, a posting to the
>Python distutils list that describes my problem can be found at
>http://mail.python.org/pipermail/distutils-sig/2007-May/007639.html
Hi Stanley. I reviewed the notes on the bug; this definitely
explains why I haven't been able to reproduce your problem under
CentOS (which is where I was testing it).
It looks to me like there are two possible long-term fixes:
1. The Fedora folks could fix brp-python-bytecompile to automatically
add the *.pyo files to the installed-files list (and adjust the
compilation location) to remove the error(s). (I think this is the
best approach, as it ensures Fedora's policy is followed even for
user-built RPMs.)
2. I could change setuptools to always generate *.pyo files when
creating RPMs, or to have the option to do so -- and we'd also have
to change the distutils in Python.
The big problem with option #2 is that even if it were considered a
bugfix for Python (which it *isn't*, since clearly the Fedora policy
change is what's breaking it), it would have to wait until a Python
2.5.x release. Is Fedora even *using* 2.5 yet?
In the meantime, there is one workaround you can use with your
distutils package. Add the following two lines to 'setup.cfg' in the
package root, adjacent to the 'setup.py' file:
[install]
optimize = 1
This will force all RPM's built with the package to include *.pyo
files, which should then dodge the
(By the way, *.pyo files actually aren't all that useless. More
recent versions of Python actually do a few optimizations on the
generated bytecode, including things like constant folding, in
addition to removing "if __debug__:" blocks and "assert" statements.)
More information about the Distutils-SIG
mailing list