classification
Title: Warn against using requires/provides/obsoletes in setup.py
Type: enhancement Stage: resolved
Components: Distutils, Documentation Versions: Python 3.5, Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: eric.araujo Nosy List: docs@python, eric.araujo, nnorwitz, tarek, techtonik, vstinner
Priority: normal Keywords: easy

Created on 2007-01-14 15:09 by techtonik, last changed 2019-07-29 11:26 by vstinner. This issue is now closed.

Messages (15)
msg31028 - (view) Author: anatoly techtonik (techtonik) Date: 2007-01-14 15:09
It would be nice to see example of setup() call on the page with "requires" keywords argument description http://docs.python.org/dist/node10.html 

Like: 
setup(...,
      requires=["somepackage (>1.0, !=1.5)"],
      provides=["mypkg (1.1)"]
      )


There seems to be mistake in table with examples for "provides" keyword on the same page - it looks like:
mypkg (1.1

shouldn't this be mypkg (1.1)?
msg31029 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2007-01-19 05:54
Thanks for the report.  I fixed the unbalanced paren.  I'll leave this open in case someone is ambitious to add more doc.

Committed revision 53487. (2.5)
Committed revision 53488.
msg31030 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2007-03-11 03:33
Anatoly, if you could create the doc in plain text, we could add it.
msg107145 - (view) Author: anatoly techtonik (techtonik) Date: 2010-06-05 16:10
Neal, why a piece from issue1635217#msg31028 doesn't qualify as an example?

It seems that this issue may become obsolete with new packaging guide coming up.
msg112787 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-08-04 11:02
This report is made obsolete by PEP 345. Be certain that distutils2 docs and tests will contain examples of Requires-Dist and Provides-Dist.
msg160473 - (view) Author: anatoly techtonik (techtonik) Date: 2012-05-12 15:16
I still need requires example - here. http://docs.python.org/distutils/setupscript.html#relationships-between-distributions-and-packages - after "Dependencies.." paragraph. =)

setup(...,
      requires=["somepackage (>1.0, !=1.5)"],
      provides=["mypkg (1.1)"]
      )
msg160755 - (view) Author: anatoly techtonik (techtonik) Date: 2012-05-15 19:59
It doesn't seem that requires parameter is honored by pip. Should we document install_requires instead?
msg160797 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-05-16 04:39
Sorry, I have to reject this again.

1) The distutils doc only gets bug fixes now.  It is more useful to spend time on distutils2.

2) requires is unusable and unused, because it contains module names, not PyPI project names. Documenting it would cause more harm than good.  Right now people use setuptools’ install_requires, which were the inspiration for the PEP 345 fields, which is implemented in distutils2.
msg160842 - (view) Author: anatoly techtonik (techtonik) Date: 2012-05-16 12:15
You've nailed it. I think it is important to know that `requires` is unused. Still this parameter is already present in documentation and causes a lot of trouble (at first I thought there is a bug with pip).

Can we still have proper comment explaining the situation with a pointer to `install_requires` without any reference to setuptools, so that the latest documentation could actually be useful?
msg160906 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-05-16 18:17
It may be good to document that requires/provides/obsoletes are effectively unused.

It is not appropriate for stdlib doc to talk about install_requires, which is specific to setuptools, and it’s better to talk about the new standard fields from PEP 345 anyway.
msg160918 - (view) Author: anatoly techtonik (techtonik) Date: 2012-05-16 19:18
PEP 345 completely misses practical side. I need to specify dependencies for my package, so that people who checked out the source code could run `pip install .` in virtualenv and get everything fetched.

People reading the docs are more practical. What is the alternative if `requires` doesn't work and `install_requires` is not official?
msg160975 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-05-17 15:30
Again, the stdlib docs do not document third-party projects.  Use the pip doc if you use pip.
msg161009 - (view) Author: anatoly techtonik (techtonik) Date: 2012-05-17 19:34
I am trying to get what's the proposed standard for users right now? How are you going to define dependencies in distutils2?
msg161011 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-05-17 20:04
Right now the standard (i.e. official) way is Requires, which is unusable; the de facto standard (but not blessed by any PEP) is setuptools’ install_requires.  The new standard is documented in d2 docs and there will be examples (http://bugs.python.org/issue1635217#msg112787).
msg348608 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-07-29 11:26
This issue seems to be controversial. I suggest to open a discussion at te Packaging forum https://discuss.python.org/c/packaging rather than using the bug tracker. I close this issue.
History
Date User Action Args
2019-07-29 11:26:25vstinnersetstatus: open -> closed

nosy: + vstinner
messages: + msg348608

resolution: out of date
stage: needs patch -> resolved
2014-06-16 22:27:55BreamoreBoysetversions: + Python 3.5, - Python 3.2, Python 3.3
2012-05-17 20:04:11eric.araujosetmessages: + msg161011
2012-05-17 19:34:59techtoniksetmessages: + msg161009
2012-05-17 15:30:38eric.araujosetmessages: + msg160975
2012-05-16 19:18:45techtoniksetmessages: + msg160918
2012-05-16 18:17:11eric.araujosetstatus: closed -> open

components: - Distutils2
title: Add example of distutils setup() with "requires" argument -> Warn against using requires/provides/obsoletes in setup.py
keywords: + easy
resolution: out of date -> (no value)
versions: + Python 2.7, Python 3.2, Python 3.3
messages: + msg160906
stage: resolved -> needs patch
2012-05-16 12:15:42techtoniksetmessages: + msg160842
2012-05-16 04:39:47eric.araujosetstatus: open -> closed
assignee: tarek -> eric.araujo
messages: + msg160797
2012-05-15 19:59:45techtoniksetmessages: + msg160755
2012-05-12 15:16:47techtoniksetstatus: closed -> open

messages: + msg160473
2010-08-04 11:02:18eric.araujosetstatus: open -> closed

versions: - Python 2.7, Python 3.3
nosy: + eric.araujo

messages: + msg112787
resolution: out of date
stage: resolved
2010-06-05 16:10:22techtoniksetversions: + Python 2.7, Python 3.3, - Python 2.6
nosy: + docs@python

messages: + msg107145

components: + Distutils, Distutils2
2009-02-11 03:10:19ajaksu2setassignee: tarek
versions: + Python 2.6, - Python 2.5
type: enhancement
nosy: + tarek
2007-08-23 21:14:48georg.brandlsettitle: Little mistake in docs -> Add example of distutils setup() with "requires" argument
2007-01-14 15:09:04techtonikcreate