Open venthur opened 1 year ago
https://packaging.python.org/en/latest/guides/single-sourcing-package-version/ refers to setup.py and the many ways how to get the version into setup.py. pyproject.toml is mentioned only as a side note.
Since setup.py is deprecated in favour of pyproject.toml, I wonder what to do with this document.
setup.py
isn't deprecated that long, and many projects are still using it. I'm for keeping the page as-is.
FWIW setup.py
isn't deprecated at all. What's discouraged is calling it directly as a script. Using it through the standard PEP 517 interface is perfectly valid use.
It would be nice, however, to swap the preference in the document. I'd still go for setup.cfg
, though, as my personal preference is to keep the metadata in a dedicated file. Besides, pyproject.toml
is still labeled as beta in setuptools
.
FWIW
setup.py
isn't deprecated at all. What's discouraged is calling it directly as a script.
There's some excellent lecture about this, maybe this can be linked?
It would be nice, however, to swap the preference in the document.
Preference for what do you mean?
For the main article contents to feature setup.cfg
, moving setup.py
to the "note" blocks.
@webknjaz To correct some misconceptions:
pyproject.toml
is not labelled as beta in setuptools. It is support for declaring configurations not standardized by PEP 621 that is still in beta stage. version is not one of those fields.
The plan from setuptools is to eventually deprecate setup.cfg
, so its use should not be recommended in the packaging guide.
+1 for moving pyproject.toml
example to the top, the existing setup.py
example is quite crufty and hacky.
thin the page needs updating:
See https://github.com/pypa/packaging.python.org/pull/1273
Please comment / edit that so we can get a nicer page together.
https://packaging.python.org/en/latest/guides/single-sourcing-package-version/ refers to setup.py and the many ways how to get the version into setup.py. pyproject.toml is mentioned only as a side note.
Since setup.py is deprecated in favour of pyproject.toml, I wonder what to do with this document. Single sourcing the version should be a non-issue. We could either strip the whole document down to pyproject.toml which would make the document very small, or move the relevant paragraph into the packaging tutorial: