[Distutils] pkg_resources: parsing requires.txt without .egg-info/ directory
Sridhar Ratnakumar
sridharr at activestate.com
Thu Jul 23 03:04:08 CEST 2009
On Wed, 22 Jul 2009 12:14:11 -0700, P.J. Eby <pje at telecommunity.com> wrote:
> t 12:08 PM 7/22/2009 -0700, Sridhar Ratnakumar wrote:
> On Tue, 21 Jul 2009 21:23:00 -0700, P.J. Eby <pje at telecommunity.com>
> wrote:
> If I were trying to do what you're doing, I'd just run a bdist_egg on
> the package and inspect it via the API. Or, alternately, I'd run the
> egg_info command with an explicit target directory, then load it via the
> regular API. (By "regular API" I mean such things as a
> find_distributions() call aimed at the parent of the .egg-info
> directory.)
> And I'd do it that way because then I wouldn't need to care whether the
> distribution was created with setuptools or not.
> How can you run egg_info ('python setup.py egg_info') on a distribution
> that does not use setuptools?
> By calling setuptools.sandbox.run_setup() with the appropriate
> arguments. (When setuptools is imported, it monkeypatches the
> distutils, such that distutils is really setuptools. That's how
> easy_install is able to build eggs from packages that don't use
> setuptools.)
Ok, anyways .. running setup.py can be a pain (eg: running egg_info on
numpy, using the sandbox, actually tries to build the extensions!).
For now, I'll go with a custom parser (like pip) .. and wait for either
you or Tarek to split setuptools into reusable modules.
Thanks.
-srid
More information about the Distutils-SIG
mailing list