On Thursday 05 April 2007 12:33, Brian Sutherland wrote:
> This is the way I'm using to get at the config of setup.py in some of my
> tools:
> from distutils.core import run_setup
> dist = run_setup('setup.py', stop_after='config')
> Then, it get's a little complex to actually get the data you want. I've
> been doing something like:
> from pkg_resources import parse_requirements
> requires = parse_requirements(dist.install_requires)
> for req in requires:
>     if req.specs:
>         for spec in req.specs:
>             op, version = spec
>             print '%s (%s %s)' % (req.project_name, op, version)

Yeah, this is a really good start! The next step would be to download the 
requirements and do this same thing again generating the graph.

Thanks for sharing!

Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
Zope3-dev mailing list
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to