[Distutils] Distutils ignoring INSTALL_SCHEMES (or: How to put data files in PURELIB)

Alexandre Gauthier alex at underwares.org
Tue Oct 2 18:01:19 CEST 2007

Hello there. I'm currently trying to package python bindings for a 
library. The bindings are currently compiled in an obscure way, so I end 
up with the following


Where mylib.py is the SWIG interface for mylib.pyd.

Since I cannot have distutils compile the bindings at all, I'd like to 
just install the pyd and dll as "data files" along with the .py in 
"site-packages". That can be accomplished with the following:

for scheme in INSTALL_SCHEMES.values():
    scheme['data'] = scheme['purelib']

However, bdist_wininst will actually ignore this, at least in python 
2.5.1. I'll end up with the pyd and dll in the DATA dir, instead of in 
the PURELIB one.

I'm really at loss on how to proceed. I read about forcing /PURELIB/ in 
front of file paths with the following:

if sys.argv[1] == 'bdist_wininst':
     for fileInfo in COMPILED_LIBS:
         fileInfo[0] = '/PURELIB/%s' % fileInfo[0]

However, that doesn't work, and complains the path for each file forced 
into PURELIB this way can't be absolute.

I also tried installing the file into an absolute path constructed from 
sys.path variables, which actually worked if I ran "setup.py install", 
but creating a bdist_wininst with that setup file actually just ignored 
the files to copy.

I'm really at loss on how to proceed. The setup file doesn't need to be 
cross platform. It just needs to be able to build a friendly windows 
installer -- that's all...

If anyone could help, i'd be immensely grateful. Thank you.
Alexandre Gauthier

More information about the Distutils-SIG mailing list