[Distutils] how can I egt the packages and modules in a distribution?

Chris Withers chris at simplistix.co.uk
Fri Aug 20 01:20:07 CEST 2010

P.J. Eby wrote:
>> Ah, okay. I assume this will only work for packages that use setuptools?
> Or distribute.  Or pip (I assume).  Anything but plain distutils, 
> basically.

Well, the packages import setup from setuptools for all of the above, 
apart from plain distutils ;-)

>> How do static resources returned with pkg_resources.resource_filename 
>> and friends fare when packages are installed in a "flat" form?
> They go in the same relative location as they would in an egg, it's just 
> that in flat layouts everyone's files are in the same namespace.
> Sort of a "scrambled egg", if you will.  ;-)

Okay, so if we have two distributions, x.a and x.b both define template 
folders called 'templates', and each has a template called 'master', 
what ends up on disk? what does 
pkg_resources.resource_filename('x.a','templates/master') return?
It should be different to 
pkg_resources.resource_filename('x.b','templates/master'), but will it be?



Simplistix - Content Management, Batch Processing & Python Consulting
            - http://www.simplistix.co.uk

More information about the Distutils-SIG mailing list