473,287 Members | 1,899 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,287 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 831
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: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

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.