Creating an RPM which works with multiple Python versions?
Edwin Young
edwin at bathysphere.org
Sun Jun 6 18:31:55 EDT 2004
Hi,
I'm developing an application which is primarily in Python but has
some C-coded extension modules. These modules aren't really useful to
anyone other than the main application. The app works fine with Python
2.2 or 2.3, so ideally I'd like to create one install package which
works with both.
I have installation largely working using distutils to create a source
tarfile and an RPM package. However I've noticed that the RPM installs
the extension libraries to /usr/lib/python2.2/site-packages, even if
python2.3 is the only version installed on the target machine - in the
latter case, my app won't work. If I move the files to the python2.3
lib dir, it all seems to work, except that I get a RuntimeWarning at
startup, indicating that the C libs were compiled against a different
Python API version.
What's recommended here? I can see 3 options:
1) Somehow convince RPM to install the extensions to the directory for
the version of Python that's installed. Any clues how?
2) Produce separate 2.2 and 2.3 packages. This is kind of a pain for
users, so I'd rather not if possible.
3) Install the modules somewhere unrelated to the python tree (eg
/usr/lib/appname-appver/ and change the python library path in the
app to find them.
Any suggestions?
Also, how can I tell if the RuntimeWarning is important? (and eliminate
it, if not?) I make fairly minimal use of the API and everything
*looks* like it works, but I don't want to risk memory corruption.
Thanks,
--
Edwin
More information about the Python-list
mailing list