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

P.J. Eby pje at telecommunity.com
Fri Jan 30 20:36:43 CET 2009

At 06:39 PM 1/30/2009 +0000, Floris Bruynooghe wrote:
>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

I'm confused by the above lines: do you mean the *project* name, or 
the name of some package within the project?  What if the project 
contains no packages, only modules?  What is libdir for?

> > 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

Moving from code to data means better tool 
interoperability.  setup.py sucks as a format for obtaining data, 
especially since many distutils newbs hardcode all sorts of rubbish 
in their setup.py files, like writing to files without paying 
attention to the command line.

>   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.

...in which case, why not just put all the files in the .egg-info to 
begin with?

Meanwhile, getting rid of package_data or *requiring* a runtime API 
to access files is going to be a major barrier to adoption in the short run.

More information about the Distutils-SIG mailing list