[Distutils] distutils data_files and setuptools.pkg_resources are driving me crazy

Phillip J. Eby pje at telecommunity.com
Sat Jul 15 01:47:38 CEST 2006


At 08:52 PM 7/13/2006 +0100, Robin Bryce wrote:

>file:setup.cfg
>[egg_info]
>egg_base=./ # because I guessed (incorrectly) that this would help.

This option controls where the .egg-info *build* directory will be, and 
*nothing* else.  But I think you figured that out.  :)

Meanwhile, I think the solution to your overall problem will require either 
expanding the metadata API to allow file access, or else adding some kind 
of path facility to the resource API (e.g. '/'-prefixed paths as you 
suggested) to access a 'data/' subdirectory of the egg-info directory.

I'll look into this option in setuptools 0.7, although I think it will also 
require some work on the install_data command.  There's also a potentially 
significant limitation in that you won't be able to look up non-package 
resources using package names.  That is, you're not going to be able to do 
resource_filename('foo.bar', '/baz').  Instead, you would have to do 
resource_filename(Requirement.parse('MyProject'), '/baz').  Again, this is 
an unfortunate quirk caused by the need to support legacy package layouts 
for system packaging tools such as RPM, Debian, etc.



More information about the Distutils-SIG mailing list