Extensions in windows.

Michel Van den Bergh vdbergh at luc.ac.be
Sat Jan 12 00:01:55 CET 2002


Thanks!

This looks like a very neat trick!

Regards,
Michel


Thomas Heller wrote:

> > "Alex Martelli" <aleax at aleax.it> wrote in message news:a1mnj5$cej$1 at serv1.iunet.it...
> > > "Michel Van den Bergh" <vdbergh at luc.ac.be> wrote in message
> > > news:3C3EDED6.98885AFE at luc.ac.be...
> > >     ...
> > > > Is there a way to make extensions on Windows which are independent of
> > > > the python version,
> > >
> > > No, sigh, not in the current Python architecture for Windows.
> > >
> > > > and if not, what is the best way to handle this
> > > > problem
> > > > in distutils? (I would like to include multiple versions of the same
> > > > extension).
> > >
> > > Distributing with sources (checking said sources build correctly
> > > with freely distributed compilers such as BCC) is one possibility,
> > > but many Windows developers aren't happy to rebuild from sources
> > > anyway (even if the C compiler is free they still have to download
> > > and install it...).
> > >
> > Here's how to create a combined source/binary distribution, even
> > for several Python versions:
> >
> > You could do 'setup.py sdist' to build a source distro,
> > and then 'python setup.py build' for every Python version which you would
> > like to create a binary for. They all have the same name (for each Python version),
> > but they are created in different subdirectories.
> > Finally add the 'build\lib.win32' subdirectory tree to the source distro zip-file,
> > and you're done.
> >
> > The user of your package can unzip it, and do a normal 'setup.py install'.
> > Distutils will execute the build_ext step, but will not try to recompile
> > the binaries, because the timestamps are ok relative to the source files
> > (even if no obj files are found). IIRC, I have first seen this
> Sorry, hit the send button too early.
> Last sentence should have been:
>   IIRC, I have first seen this in the pygame distro.
>
> Thomas




More information about the Python-list mailing list