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

Re: Status report on python2 transition



Gregor Hoffleit wrote:
> Pure Python packages not necessarily would need to be rebuilt (if the
> code was cross-version compatible).

It almost always is.  Python tries very hard to remain source compatible
across releases.  I've been using Python for 9 years and can only think
of one case were my code broke after an upgrade.

> Possible solutions for cross-version compatible code would be
> installation in a version-neutral directory (e.g.
> /usr/lib/python/site-packages) and either adding this to sys.path (has
> been depreciated in python-dev) or somehow arranging symlinks into the
> actual versioned site-package directories.

I assume we are talking about cross-version compatible _library_ code
now (ie. libraries implemented in Python).  In that case, something like
/usr/lib/python/site-packages sounds like a reasonable solution to me.

Note that Python is smart enough to check the version numbers of
bytecompiled code.  For example if foo.py and foo.pyc both exist but the
.pyc file is an old version then the .py file is used.  This slows down
the import a bit but causes no other ill effects.

I think it may be enough to have Python library code install itself in
/usr/lib/python/site-packages and be compiled by the currently installed
version of Python.  If python-base is upgraded then its postinst
recompiles all of the code in site-packages.

Could it be that simple?  Maybe I've missed something.

  Neil



Reply to: