Suggested directory convention
Lots of distribution formats need a place to put files that aren't really temporary, can often be generated by the Distutils, but may be tweaked by the developer (and put under source control). I'm thinking of RPM's spec files, Debian's directory of package meta-data, Wise scripts, and similar stuff. Seems like a good idea to me to put this all in a directory "dist": the first time you use the Distutils to generate a .spec file, or a Wise script, or what-have-you, it would create "dist" and would always put those sort of files in there. Naturally, this would be a configurable option to the bdist_* commands, but "dist" strikes me as a sensible default. This is distinct from the "build" directory for two reasons: 1) it's for distribution, not building -- hence the domain of the module developer rather than the installer/packager; 2) it's not temporary -- it's always safe to blow away the "build" directory, but could be foolish to ditch "dist". (Eg. if someone has started with Distutils-generated files and customized them to suit.) In addition to the bdist_* commands, the sdist command could possibly use the dist tree for creating source archives. (Currently, it creates <distname>-<version> (eg. "Distutils-0.8.3") in the distribution root, fill it up with copies or hardlinks to all the files in MANIFEST, and creates an archive rooted at <distname>-<version>. If we move that source distribution tree down a level, we'd have to chdir to create the source archive.) Opinions? Sound like a good idea or just more complexity? Greg -- Greg Ward - nerd gward@python.net http://starship.python.net/~gward/ When the ship lifts, all bills are paid. No regrets.
I like it alot! It could also hold package install scripts that aren't really part of the distribution but are necessary for packaging binary distributions. I use this convention for my Solaris/HP (non-python) packages by having a "pkgfiles" directory that installed either under the package directory, or if the package was installed in /usr or /usr/local, it went to /var/pkgfiles/pkg-name. This makes the binary package re- creatable on any system that it's installed on (unlike RPM, these package managers don't require the source). In some cases, I would like to do the same with Python packages, e.g. have the "dist" directory installed under the package installation directory. It's frequently usefull to have access to pre/post install scripts at other times, and they're generally not big enough to be a space concern. Mark Alexander mwa@gate.net
On 31 May 2000, Mark W. Alexander said:
I like it alot!
Oh good, 'cause I've already started sorta-kinda moving "bdist_rpm" in that direction. (If run with --spec-only, it now drops the spec file in "dist" rather than "redhat". The directory name is still hard-coded, though.) Greg -- Greg Ward - programmer-at-large gward@python.net http://starship.python.net/~gward/ Well, I didn't expect a sort of Spanish Inquisition!
On Wed, May 31, 2000 at 09:44:04PM -0400, Mark W. Alexander wrote:
In some cases, I would like to do the same with Python packages, e.g. have the "dist" directory installed under the package installation directory. It's frequently usefull to have access to pre/post install scripts at other times, and they're generally not big enough to be a space concern.
And binary package making commands like bdist_rpm could look in the directory to find the default scripts, which would make one less thing to put into package_data (in fact, maybe this could almost eliminate package_data if configuration, build, and install scripts were placed here, I think most other parts of package_data could be moved into setup.py as meta-data.) -- Harry Henry Gebel, Senior Developer, Landon House SBS West Dover Hundred, Delaware
On 31 May 2000, Harry Henry Gebel said:
And binary package making commands like bdist_rpm could look in the directory to find the default scripts, which would make one less thing to put into package_data (in fact, maybe this could almost eliminate package_data if configuration, build, and install scripts were placed here, I think most other parts of package_data could be moved into setup.py as meta-data.)
Actually, tonight I started work on making package_data entirely obsolete by putting that information in the config file, setup.cfg. Here's what it would look like: [bdist_rpm] release = 3 packager = Harry Henry Gebel <hgebel@inet.net> doc = CHANGES.txt README.txt USAGE.txt doc/ examples/ changelog = * Wed May 31 2000 Greg Ward <gward@python.net> 0.8.3pre-1 - Hacked up bdist_rpm.py, moved meta-data into setup.cfg * Thu May 10 2000 Harry Henry Gebel <hgebel@inet.net> 0.8.2-3 - Added new options to package_data * Tue May 09 2000 Harry Henry Gebel <hgebel@inet.net> 0.8.2-2 - Include RPM_OPT_FLAGS in distutils * Wed Apr 26 2000 Harry Henry Gebel <hgebel@inet.net> 0.8.2-1 - First test of bdist_rpm Look familiar? There are some whitespace issues with the changelog, and I don't see a good way to map your multi-locale "summaries" and "descriptions" dictionaries to options in the config file. Maybe a complicated string like "key: value, key: value", but it would have to be shlex'd to allow quoting keys and values. The code's in upheaval at the moment, so not checked in. But I did check in some other changes to bdist_rpm that you should keep on top of! Oops, that was off-topic as hell. Oh well. Sounds like the "dist" directory is a winner. Now I just have to figure out what goes there and what goes in "build/bdist.<plat>/<format>"... Greg -- Greg Ward - Linux nerd gward@python.net http://starship.python.net/~gward/ It has just been discovered that research causes cancer in rats.
participants (3)
-
Greg Ward
-
Harry Henry Gebel
-
Mark W. Alexander