On Mon, Nov 12, 2012 at 3:39 PM, PJ Eby <pje@telecommunity.com> wrote:
On Sat, Nov 10, 2012 at 6:51 AM, Vinay Sajip <vinay_sajip@yahoo.co.uk> wrote:
Carl Meyer <carl <at> oddbird.net> writes:

> already satisfied. In pip this happens here:
> https://github.com/pypa/pip/blob/develop/pip/req.py#L1091
>
> More generally, I wouldn't really recommend pip's dependency resolution
> logic as a model for new Python code in this area. There are some not
> uncommon cases that it handles poorly; see
> https://github.com/pypa/pip/issues/174 and
> http://bugs.python.org/issue8927. (To be fair to pip, these cases aren't
> trivial when you have to download and unpack an sdist before you can

Thanks for the pointers.

> find out anything about its dependencies, but I'd hope that with the new
> metadata PEPs Python packaging code could get a bit smarter in this area.)

AFAICT, the proposed metadata PEP changes don't offer the same requirement
granularity as setuptools / distribute (for example, 'Requires-Dist' as against
'install_requires', 'setup_requires', 'test_requires').

Anyway, I'll take a look at the issue you mentioned and see how the dependency
code in distlib stacks up. Currently, it keeps the requirements distinct for
'install', 'setup' and 'test'. The distinctions seem reasonable in theory,
though I'm not sure how useful they are in practice.

Test dependencies allow you to depend on a test framework (e.g. nose) without requiring it to be installed at runtime.  Setup dependencies let you depend on tools like Pyrex or Cython in order to compile a binary package, without requiring them to be available at runtime.

I'm not sure this is well understood, let's make sure everyone gets this.

With setup/test requirements as implemented in setuptools nose, Pyrex, Cython, whatever can be on PYTHONPATH during the install but are not available when the install is done. You get to use them without cluttering up your normal runtime environment. This is implemented by installing nose in a uniquely named subdirectory of the sdist that is being installed and adding that directory to PYTHONPATH/sys.path during the install / test command run.


I would like to see distutils (1, 2, any number) banished from the stdlib to become a common setup-requires requirement.