[Distutils] Problems with --record option.

M.-A. Lemburg mal at egenix.com
Sun Jul 25 13:01:30 CEST 2004

Sean Reifschneider wrote:
> I've checked both the Distutils in Python 2.3.4, and the CVS version,
> they both have this problem.
> If you do a "python setup.py install --record INSTALLED_FILES", on a
> package that installs .py files, the INSTALLED_FILES list will include
> the .py files installed, but not the .pyo and .pyc files which were
> generated because of the compile.
> This in particular causes problems with "bdist_rpm", which relies on
> --record.  Newer RPMs, unless otherwise configured not to, will complain
> and die if there are files in the installation directory which are not
> in the %files section.  The %files section generated in the RPM spec
> file is pulled from "INSTALLED_FILES".
> I'm not sure what the right way to approach this is, though.  I'd think
> that if you are compiling the .py files, you'd want to write the names
> of the .pyo and .pyc files into the --record when you write the .py
> file names.  On the other hand, you can also add the lines:
>    ( cd "$RPM_BUILD_ROOT"; find . -type f \( -name \*.pyo 
>       -o -name \*.pyc \) ) | sed 's/^\.//' >>INSTALLED_FILES
> after the "python setup.py install" lines in the spec file.

Looking at the code in build_py.py the byte code files are
included in the output and there's extra code in install_lib.py
to make sure that the byte code files get included in the
output too.

I'm not really sure where the byte code files are lost on
the way out into INSTALLED_FILES.

Marc-Andre Lemburg

Professional Python Services directly from the Source  (#1, Jul 25 2004)
 >>> Python/Zope Consulting and Support ...        http://www.egenix.com/
 >>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::

More information about the Distutils-SIG mailing list