[Distutils] Did I miss setup of distutils cookbook location?

Mike C. Fletcher mcfletch at rogers.com
Mon Apr 5 18:27:19 EDT 2004

We'd discussed at PyCon having a distutils recipe collection; having 
just donated a cooked setup.py to another project I'm thinking it might 
be nice to instead upload such things for general consumption.  Quick 
survey of PyOpenGL and one or two other projects in my stable gives:

    * Pete Shinner's "smart_install_data" (keeps resource files in the
      same directory relative to the original source, as 99% of projects
      I'm aware of really want (i.e. specifying --install-lib doesn't
      scatter your projects into two different locations)).  There's an
      older, much larger version by Rene L. as well that we don't use
      any more.
    * Boilerplate code for working around Python 2.2 distutils inability
      to handle extra arguments to setup (e.g. PyPI metadata).
    * packagesFor( ) function (to automate specification of sub-packages
      instead of requiring user to specify all packages manually (and
      then remembering to update the list when a new sub-package is
    * nonPythonFilesFor( ) function (to automate generation of
      data-files lists for use with smart_install_data)
    * customise bdist_wininst filename (e.g. to include Numpy version or
      other dependencies)
    * adding sub-commands to build
    * define/undefine compilation flags based on ability to compile a
      testing C module (based on config, though this seems to cause an
      annoying habit of running the darn thing dozens of times for large
      projects), basically allowing for tests of whether a system has a
      particular header available, or uses some particular feature that
      you need to if-def around in your C modules
    * create shortcuts on win32 (this one hasn't been used in a while,
      not sure if it still works)

Much of the code is pretty simple-minded (particularly the functions for 
scanning for packages and non-python files) but they do seem to be 
fairly useful.  We'd want to review the code to see what's 
best-practices and what can be done to make it better.

There's also far more involved things, such as DOCBOOK XML to (X)HTML 
conversions and the SWIG automation stuff for building multiple versions 
of files for different API versions and the like which wouldn't be 
appropriate as recipes, but might be useful for new distutils packagers 
to see as sample code.

Anyway, if we've already got a space set up, let me know and I'll try to 
get some time to work on cleaning up and uploading these things.  Have fun,

  Mike C. Fletcher
  Designer, VR Plumber, Coder

More information about the Distutils-SIG mailing list