packaging.python.org icon indicating copy to clipboard operation
packaging.python.org copied to clipboard

Contradictions/Inconsistencies between packaging tutorial and guide

Open primesun opened this issue 4 years ago • 10 comments

Page 1: Packaging Python Projects Page 2: Packaging and distributing projects

The first states

"setup.py # optional, needed to make editable pip installs work"

The second states

"The most important file is setup.py which exists at the root of your project directory."

The first mentions pyproject.toml, whereas the second doesn't mention it at all.

I know that one's a "tutorial" and the other is a "guide", and the website states that guides have more detailed information. In this case it appears there's some detail in the tutorial that isn't in the guide.

primesun avatar Apr 27 '21 04:04 primesun

Agreed. That sounds reasonable.

webknjaz avatar Apr 27 '21 12:04 webknjaz

"needed to make editable pip installs work" is actually not true anymore since the most recent pip release. Unless you are on an old Python unsupported by the most recent pip release. :)

henryiii avatar May 21 '21 05:05 henryiii

@henryiii do you have an issue or a PR link with the change? I don't recall seeing that.

webknjaz avatar May 21 '21 08:05 webknjaz

Either https://pip.pypa.io/en/stable/news/#v21-1 (under features, can't really link to the header because they are auto-generated, so identical for all versions) or https://github.com/pypa/pip/pull/9547.

henryiii avatar May 21 '21 14:05 henryiii

Note that this still doesn't cover non-setuptools build backends.

pradyunsg avatar May 21 '21 14:05 pradyunsg

Well, the comment about setup.py being required is also for the setuptools backend. But yes, it's not editable PEP 517 support.

henryiii avatar May 21 '21 14:05 henryiii

This seems related to #866 (specifically https://github.com/pypa/packaging.python.org/issues/866#issuecomment-845951158).

bhrutledge avatar May 25 '21 23:05 bhrutledge

Also, rather than update https://packaging.python.org/guides/distributing-packages-using-setuptools/, could it be replaced with links to the setuptools docs? They've seen some dramatic improvements.

bhrutledge avatar May 26 '21 00:05 bhrutledge

This feels related to https://github.com/pypa/packaging.python.org/issues/792.

bhrutledge avatar Jun 19 '21 11:06 bhrutledge

"needed to make editable pip installs work" is actually not true anymore since the most recent pip release. Unless you are on an old Python unsupported by the most recent pip release. :)

For whoever also wanted to know what "old Python" and "most recent pip" mean: the current sample project (https://github.com/pypa/sampleproject/commit/fc8d83efd5749853507be959d858629d0aaf5c6e), which has no setup.py, does install with pip install -e . for pip 21.3.1 and Python 3.7, but not with the older pip 21.3 or Python 3.6.

Since Python 3.6 is end of life, all currently supported Python versions support a recent enough pip, and thus editable pip installs sans setup.py should work on all currently supported systems. This was not true at the time the parent comment was written, since Python 3.6 was still supported then. So to me there seems to be no reason anymore to include a setup.py.

The guide should be updated, because it still refers to setup.py in the sample project, see #1184.

hugobuddel avatar Apr 30 '23 07:04 hugobuddel