By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,898 Members | 1,198 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,898 IT Pros & Developers. It's quick & easy.

Distributing 2 python modules with incompatible API

P: n/a
hi there,

As far as I understand python is not using the usual UNIX system of
soname when two libraries provide incompatible API. So let say I have
a _foo.so version 1.2 and 2.0, all I can (should do) is move them
underneath a subdirectory in site-package:

pythonX.Y/site-package/foo1.2/_foo.so
pythonX.Y/site-package/foo1.2/foo.py
and
pythonX.Y/site-package/foo2.0/_foo.so
pythonX.Y/site-package/foo2.0/foo.py

Then a central foo.pth would (sytem-wide) define which one is the
default version:

pythonX.Y/site-package/foo.pth

If this is correct ? Is there any documentation that I missed ?

Thanks
-Mathieu
Jun 27 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
mathieu wrote:
hi there,

As far as I understand python is not using the usual UNIX system of
soname when two libraries provide incompatible API. So let say I have
a _foo.so version 1.2 and 2.0, all I can (should do) is move them
underneath a subdirectory in site-package:

pythonX.Y/site-package/foo1.2/_foo.so
pythonX.Y/site-package/foo1.2/foo.py
and
pythonX.Y/site-package/foo2.0/_foo.so
pythonX.Y/site-package/foo2.0/foo.py

Then a central foo.pth would (sytem-wide) define which one is the
default version:

pythonX.Y/site-package/foo.pth

If this is correct ? Is there any documentation that I missed ?
You can use setuptools + pkg_resources to install versions in parallel -
then you need to do an explicit

pkg_resources.require("foo == 1.2")

before importing foo the first time.

Diez
Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.