[Distutils] [Python Language Summit] Distutils / Packaging survey

Floris Bruynooghe floris.bruynooghe at gmail.com
Fri Jan 30 19:39:51 CET 2009

On Fri, Jan 30, 2009 at 01:21:12AM +0100, Tarek Ziadé wrote:
> On Fri, Jan 30, 2009 at 12:34 AM, Floris Bruynooghe
> <floris.bruynooghe at gmail.com> wrote:
> > An argument against a generated .py file is that this won't work for
> > single-module python distributions.  But having a .cfg file or
> > something next to the module/package might defeat the point of trying
> > to help the FHS in violating it already.  OTOH .egg-info does that too
> > and seems to be accepted currently.
> Well, the egg-info file is the static version of setup.py metadata in some way,
> I would find a new file redundant.
> I am really curious though, to see what the file would contain..

I imagine things like libdir, prefix, datadir, docdir and other things
copied from autoconf.  Where the defaults would be something like:

prefix = sys.prefix
libdir = sys.prefix/lib/pythonX.Y/site-packages/pkgname
datadir = sys.prefix/share/mypackage
docdir = sys.prefix/share/doc/mypackage

> from my current understanding, and having in mind to introduce such a
> file in a way things
> can gently evolve:
> What if an egg-info-like file was present in the package from the very
> beginning,
> describing the package metadata, and used by setup.py, *and* at build time
> by third party tools. (with setup.py knowing that it can be changed at run time)

I don't see why moving all the metadata to egg-info would improve
things.  You could easily(?) deprecate the `package_data' and
`data_files' keywords to setup() and replace them with `doc_files',
`data_files', `man_files', `config_files', etc.  And depending on
which --sysconfdir, --datadir, etc options where used to setup.py
install_egg_info would write the correct values for datadir etc.  The
runtime would then use your pkginfo.get_metadata() to find the files.

It might even be possible to do all of this inside distutils without
breaking backwards compatibility, just deprecating some keywords once
people start liking and using it.


Debian GNU/Linux -- The Power of Freedom
www.debian.org | www.gnu.org | www.kernel.org

More information about the Distutils-SIG mailing list