At 11:32 PM 8/19/2010 +0100, Chris Withers wrote:
P.J. Eby wrote:
I'm trying to write a scanner than looks for SQLAlchemy table objects and it would be great to be able to pass a distribution name rather than a set of dotted package names...
get_distribution('projectname').get_metadata('top_level.txt').splitlines() will return you a list of top-level package or module names provided by the package.

Ah, okay. I assume this will only work for packages that use setuptools?

Or distribute.  Or pip (I assume).  Anything but plain distutils, basically.


I assume this is only a problem for namespace packages?
(ie: if so packages each supply part of a namespace, they will both have the namespace listed in top_level.txt, right?)

Correct.


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

_______________________________________________
Distutils-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to