[python-win32] PyWin32 extensions can now be built using distutils

Mark Hammond mhammond at skippinet.com.au
Mon Dec 1 20:03:43 EST 2003


This is for anyone who builds PyWin32/win32all from CVS source code.

Currently, the instructions for building these extensions require you to use
Visual Studio, and perform lots of magic fiddling to get everything
installed and working.  But thanks to Thomas Heller, we now have a
'distutils' setup script that does all this magic for you.

I'd like anyone who builds from sources (or anyone who would like to, but
failed in the past) to try this out for me.  Eventually, I will update the
build instructions accordingly to make this the 'official' way to build and
install these extensions from source.  You still need MSVC (but should *not*
need Visual Studio - only the command-line compiler is used)

To test this, follow these instructions:
* Remove any win32all installations, and remove any previously built
win32all extensions.  This isn't strictly necessary, but will help me to
ensure that everything works.  It will also avoid one or 2 duplicate files
(notably, the .exe files)
* Pull the latest source-code from CVS - see the project sourceforge page.
* In the root directory, execute 'setup_win32all.py', with no arguments.
This will print a couple of pages of usage information, including what
params you use to build and install.  The short course is "setup_win32all.py
install" will build and install all the extensions.

Once installed, you will find all built .pyd/.dll/.exe files, and .py files,
installed into your "site-packages" directory, as a normal win32all
installation would do.  You can build for multiple versions of Python simply
by changing the 'python.exe' used to execute 'setup_win32all.py'.
Instructions are also provided for building (and installing) debug versions
of the extensions.

If anyone does try this, please let me know how you go - successful or
otherwise.

Thanks!

Mark.




More information about the Python-win32 mailing list