[Distutils] [issue82] API for exposing the contents of requires.txt (and perhaps other metadata in .egg-info/)

Sridhar Ratnakumar setuptools at bugs.python.org
Wed Jul 22 02:06:35 CEST 2009


New submission from Sridhar Ratnakumar <sridharr at activestate.com>:

On Mon, 20 Jul 2009 17:20:44 -0700, P.J. Eby <pje at telecommunity.com> wrote:
 
At 01:26 PM 7/20/2009 -0700, Sridhar Ratnakumar wrote:
On Sat, 18 Jul 2009 19:31:36 -0700, P.J. Eby <pje at telecommunity.com> wrote:
 discovery.resources -- basically pkg_resources under a different name
 It may also be worth adding support for parsing the files under .egg-info
- for instance, those 'extras' in requires.txt.
 See the 'requires()' method of Distribution objects:
 http://peak.telecommunity.com/DevCenter/PkgResources#distribution-methods
 
I've already looked into that before (in pkg_resources.py) - unfortunately, 
this does not return all of requires.txt (as Python dict, that is), but only 
*what* you specify in the 'extras' argument (how am I supposed to know the /
possible/ extras sections beforehand?).
 
The closest I've come to is using `split_sections` and `_get_metadata` to 
construct the dict myself. But that is not the ideal way to provide/use an API.
 

PJE: Ah, you didn't say that, you just said "parse".  If you'll file a feature 
request, I'll replace _dep_map with a public attribute for accessing that 
information in a future release.  In the meantime, you're quite safe 
using ._dep_map, since obviously I'm not going to change it out from under 
you.

----------
assignedto: pje
messages: 330
nosy: pje, srid
priority: wish
status: chatting
title: API for exposing the contents of requires.txt (and perhaps other metadata in .egg-info/)

_______________________________________________
Setuptools tracker <setuptools at bugs.python.org>
<http://bugs.python.org/setuptools/issue82>
_______________________________________________


More information about the Distutils-SIG mailing list