[Distutils] Create 'bdist' installer from already-compiled SWIG DLL/SO

John Pye john.pye at student.unsw.edu.au
Thu Apr 27 07:38:08 CEST 2006


Hi all,

I have a C++ library that I recently wrapped to allow it it be used from 
Python. I have used SCons as my build tool, and I want to continue using 
that.

Now that I have completed my python language bindings, I want to work 
out a sensible way to create an installable version of this code. I want 
to use the python 'distutils' as that seems to be preferable (in the 
case of Python programs) to using something like NSIS.

How can I use distutils to package up an *already-built* wrapper .py and 
.dll file? I don't have any other files that I need to distribute. 
Everything in the distutils documentation assumes that you will use 
Python to compile from sources. But the SWIG support in distutils is not 
complete enough (and anyway, I want to use SCons for the compiling stage).

Here is my current effort, but it doesn't handle the 'dll' correctly 
(and isn't cross-platform, but that's OK):

#!/usr/bin/env python

from distutils.core import setup, Extension

setup(name='freesteam'
    , version='0.6'
    , py_modules=['freesteam']
    , ext_modules=[Extension('_freesteam',['_freesteam.dll'])]
)

Any suggestions would be great.

Cheers
JP

-- 
John Pye
Department of Mechanical and Manufacturing Engineering
University of New South Wales, Sydney, Australia
http://pye.dyndns.org/



More information about the Distutils-SIG mailing list