[Distutils] Including DLLs in binary distributions

Jean-Paul Calderone exarkun at divmod.com
Mon Jul 20 23:55:49 CEST 2009


Hello all,

I'm trying to figure out how to include some extra DLLs which are required
by an extension module I'm trying to package (pyOpenSSL).

>From what I can tell, the DLLs need to be in the same directory as the
extension modules themselves (the .pyd files).  Does anyone know if this
is the best place for them?

Based on my current understanding, I've used the data_files feature of
distutils to put the DLLs into site-packages/OpenSSL/.  This works fine for
bdist_msi (and I hope bdist_exe, though I haven't checked that yet).  However,
bdist_egg has tripped me up.  The path given in data_files is interpreted
relative to the egg itself.  This differs from the interpretation of those
values by the other bdist_ commands.

Here are the actual values I'm using:

  data_files = [('Lib\\site-packages\\OpenSSL',
                 ['C:\\OpenSSL\\ssleay32.dll',
                  'C:\\OpenSSL\\libeay32.dll'])]

How can I get these files into the right place for bdist_egg?

Jean-Paul


More information about the Distutils-SIG mailing list