[Maciej] > Suppose I distribute a Python module. It gets installed on a couple > systems. After a while, I need to introduce a backward-incompatible > API change. If I shiped the updated library, all the programs using > the library would break. > > C libraries have a mechanism to deal with this problem. Every library > has a SONAME, for example "libfoo.so.0", which denotes the version of > the API. If the API of the library changes, a shared library with a > new soname is created, for example "libfoo.so.1". Both libfoo.so.0 > and libfoo.so.1 can be installed on a single system. Executables or > other libraries using libfoo can find libfoo.so.0 or libfoo.so.1 > depending on which one they've been originally linked against. > > Is there a similar mechanism for Python? I can think of a couple ways > of implementing/emulating it, but I don't want to prise an open door. > What would you suggest?
Setuptools has extensive versioning support: you can package "eggs" by explicit version number, by revision number, etc. Multiple versions of an "egg" can be installed on a given system at any time. Changing which one gets imported at runtime is a simple matter of specifying which version of the "egg" you require. http://peak.telecommunity.com/DevCenter/EasyInstall#changing-the-active-version Setuptools is a bit out-of-date now, primarily because it's unmaintained. So if you're interested in this route, you should be looking at "Distribute", an active project forked from setuptools. (I haven't used Distribute yet myself). http://pypi.python.org/pypi/distribute Alan.
-- You received this message because you are subscribed to the Google Groups "Python Ireland" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pythonireland?hl=en.
