Did I miss setup of distutils cookbook location?
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 created)) * 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 _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/
On Mon, Apr 05, 2004 at 06:27:19PM -0400, Mike C. Fletcher wrote:
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
I've just set something up in the Python Wiki; the main page is http://www.python.org/cgi-bin/moinmoin/DistutilsCookbook . Edit this page to add links to the recipes you list; I would have added them, but have to run. --amk
Mike C. Fletcher schrieb:
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. It isn't that much larger, if you consider the amount of code you don't have to write by using MANIFEST-like templates to collect your file names. (about one third of the code) On the other side it gives you more control where your files are copied to. (stripping of leading directories, ...) (about one half of the code)
It was designed to be more general in solving the problem, so it is more code in it. http://cvs.sourceforge.net/viewcvs.py/pyopengl/PyOpenGL2/setup/my_install_data.py?rev=1.1&view=auto (And as I see in the CVS you are still using it? http://cvs.sourceforge.net/viewcvs.py/pyopengl/PyOpenGL2/setup.py?rev=1.61&view=auto ) Kind regards Rene Liebscher
.....
_______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/
René Liebscher <R.Liebscher@gmx.de> writes:
Mike C. Fletcher schrieb:
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 is also a clever hack which has been posted to c.l.p: <http://groups.google.com/groups?selm=f70e3538.0404141327.6cea58ca%40posting.google.com> I haven't tried it though. Thomas
participants (4)
-
A.M. Kuchling
-
Mike C. Fletcher
-
René Liebscher
-
Thomas Heller