473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Distributing 2 python modules with incompatible API

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
1 833
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Edmond Rusjan | last post by:
Hi All, I'd like to use Python-2.3.4 on OSF1 V4.0, but have trouble installing. With a plain "./configure; make" build, I cannot import socket. If I uncomment the socketmodule in Modules/Setup,...
5
by: Jiri Barton | last post by:
Hi, I'd like to be able to distribute some python modules of my system (plugins) without the source. So far, I have done this by including only the *.pyc files. However, I have recently found...
53
by: Stelios Xanthakis | last post by:
Hi. pyvm is a program which can run python 2.4 bytecode (the .pyc files). A demo pre-release is available at: http://students.ceid.upatras.gr/~sxanth/pyvm/ Facts about pyvm: - It's FAST....
2
by: RickMuller | last post by:
I really appreciate the ease that the distutils make distributing Python modules. However, I have a question about using them to distribute non-Python (i.e. text) data files that support Python...
66
by: Srijit Kumar Bhadra | last post by:
Is there any specific reason for not using MinGW to build the official distribution of Python for Win32? A quick Google search did not reveal the answer to my question. If a link is available,...
11
by: Tina I | last post by:
Hi list, Is there a preferred way to distribute programs that depends on third party modules like PyQt, Beautifulsoup etc? I have used setuptools and just having the setup script check for the...
9
by: eliben | last post by:
Hello, I'm getting into Python now after years of Perl, and as part of my research I must understand how to do some common tasks I need. I have a bunch of Windows PCs at work to which I want...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.