Distributing compiled (swig) python modules

M

mathieu

Hi there,

I have prepared binaries of a python module that I wrote. Basically
the lib is written in C++ and wrapped in python using SWIG. Of course
it links to the python dynamic libraries. I found out that this is
version dependant. For instance if I prepare the binaries on my
machine with a python 2.4 installation this module will not load
properly on a python 2.5 / 2.6 installation.

Is there some documentation (that I missed in my previous google
search) that describe how to prepare python module that can be
redistributed with some kind of backward compatibility (= so that when
prepared on python 2.4, it works on 2.5/2.6 at least) ?

Thanks
 
D

Diez B. Roggisch

mathieu said:
Hi there,

I have prepared binaries of a python module that I wrote. Basically
the lib is written in C++ and wrapped in python using SWIG. Of course
it links to the python dynamic libraries. I found out that this is
version dependant. For instance if I prepare the binaries on my
machine with a python 2.4 installation this module will not load
properly on a python 2.5 / 2.6 installation.

Is there some documentation (that I missed in my previous google
search) that describe how to prepare python module that can be
redistributed with some kind of backward compatibility (= so that when
prepared on python 2.4, it works on 2.5/2.6 at least) ?

There is no such way, and can't be because of C-API-changes in python.dlls.
You will have to offer your library separately for each python version you
support.

I don't know too much about SWIG, but if you can make your whole
build-process based on distutils or setuptools, you should be able to
produce eggs to install that your users then can install very easy.

Diez
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,814
Latest member
SpicetreeDigital

Latest Threads

Top