[Distutils] install_requires vs. requires_dist, and setup.cfg
Asheesh Laroia
lists at asheesh.org
Mon Apr 7 06:07:40 CEST 2014
>From what I understand in PEP 345, "Requires-Dist" is the name in PKG-INFO
files for a distribution's dependencies on other distributions.
>From what I also understand from personal experience, when using
setuptools, install_requires is the name of the keyword argument to setup()
that specifies a dependency on another distribution.
Sanity-check: This doesn't mean that one should call setup() with a
"required_dist" keyword argument, right?
Relatedly,
https://mail.python.org/pipermail/distutils-sig/2010-January/015211.htmlseems
to suggest that one day in our glorious future, when we can lay down
our setup.py files and switch to setup.cfg, then we can call it
requires_dist in that format.
As I understand it. the setup.cfg revolution never happened, so I should
still encourage new people packaging their own things to write
install_requires in their calls to setuptools.setup().
Also, I just created a trivial setup.py that contains an "install_requires"
and doing "python setup.py develop --user" does seem to have created a
PKG-INFO file, but it doesn't have a "Requires-Dist" line.
Details of my test case:
➜ rofl python
Python 2.7.6 (default, Mar 22 2014, 15:40:47)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import setuptools
>>> print setuptools.__version__
3.4.2
➜ rofl cat setup.py
from setuptools import setup
setup(install_requires=['mwparser'])
➜ rofl grep mwparser UNKNOWN.egg-info/*
UNKNOWN.egg-info/requires.txt:mwparser
I expected to also see it in a Requires-Dist property within
UNKNOWN.egg-info/PKG-INFO. Is that a mistaken expectation? If so, what if
anything writes a "Requires-Dist" line anywhere?
Thanks for your patience with me, and for your speedy responses so far! I'm
really hoping to provide as much high quality information to people at
PyCon as I can, and grateful that so many wise people are willing to have
these conversations with me.
-- Asheesh.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20140406/833007c5/attachment-0001.html>
More information about the Distutils-SIG
mailing list