[csw-devel] SF.net SVN: gar:[16652] csw/mgar/pkg/subversion/trunk/Makefile

Maciej (Matchek) Bliziński maciej at opencsw.org
Sat Jun 30 17:22:48 CEST 2012


2012/6/24 Peter FELECAN <pfelecan at opencsw.org>
>
> Maciej Bliziński <maciej at opencsw.org> writes:
> > On Mon, Jan 02, 2012 at 08:17:25PM +0000, rthurner at users.sourceforge.net
> > wrote:
> >> +CHECKPKG_OVERRIDES_CSWpythonsvn +=
> >> discouraged-path-in-pkgmap|/opt/csw/lib/svn/python/site-packages/svn/repos.pyc
> >> +CHECKPKG_OVERRIDES_CSWpythonsvn +=
> >> discouraged-path-in-pkgmap|/opt/csw/lib/svn/python/site-packages/svn/wc.pyc
> >> +CHECKPKG_OVERRIDES_CSWpythonsvn +=
> >> discouraged-path-in-pkgmap|/opt/csw/lib/svn/python/site-packages/libsvn/__init__.pyc
> >> (...)
> >
> > We don't ship *.pyc files in Python packages. We use the pycompile class
> > instead, and generate the *.pyc files locally. Instead of overriding the
> > error tags, you can remove the files in a post-install-modulated step
> > and set the pycompile class on them.
>
> Sincerely, I don't get the rationale of this: pyc as elc (e-lisp
> compiled) are architecture neutral. The only reason that I can imagine
> is that compiling on the target, i.e., on which the package containing
> the source is installed, uses environmental, i.e., specific,
> information, e.g. Python's current version.
>
> As our Python reference, can you enlighten us on this?

Yes, the *.pyc and *.pyo files are platform-independent. I found the
corresponding Debian policy document:

http://www.debian.org/doc/packaging-manuals/python-policy/ch-module_packages.html#s-byte_compilation

"(...) the corresponding byte-compiled modules (foo.pyc files) and
optimized modules (foo.pyo files) must not ship in the package."

"Pure Python modules in private installation directories that are
byte-compiled with the default Python version must be forcefully
byte-compiled again when the default Python version changes."

It's not stated directly, but it sounds like the byte-compiled files
are dependent on the version of Python runtime. Compiling them in
post-install allows to not update the packaged modules if the runtime
changes and the module is source-compatible with the new runtime.

Maciej


More information about the devel mailing list