[5.1.x] Migrated setuptools configuration to pyproject.toml.

This branch migrates setuptools configuration from setup.py/setup.cfg to
pyproject.toml. In order to ensure that the generated binary files have
consistent casing (both the tarball and the wheel), setuptools version
is limited to ">=61.0.0,<69.3.0".

Configuration for flake8 was moved to a dedicated .flake8 file since
it cannot be configured via pyproject.toml.

Also, __pycache__ exclusion was removed from MANIFEST and the
extras/Makefile was replaced with a simpler build command.

Co-authored-by: Nick Pope <nick@nickpope.me.uk>

Backport of 4686541691 from main.
This commit is contained in:
Claude Paroz 2024-06-24 20:34:43 +02:00 committed by Natalia
parent 3d55f2966d
commit b4dd76c315
9 changed files with 83 additions and 143 deletions

View file

@ -46,7 +46,7 @@ Python style
* Unless otherwise specified, follow :pep:`8`.
Use :pypi:`flake8` to check for problems in this area. Note that our
``setup.cfg`` file contains some excluded files (deprecated modules we don't
``.flake8`` file contains some excluded files (deprecated modules we don't
care about cleaning up and some third-party code that Django vendors) as well
as some excluded errors that we don't consider as gross violations. Remember
that :pep:`8` is only a guide, so respect the style of the surrounding code

View file

@ -83,7 +83,7 @@ permissions.
.. code-block:: shell
$ python -m pip install wheel twine
$ python -m pip install build twine
* Access to `Django's project on PyPI <https://pypi.org/project/Django/>`_ to
upload binaries, ideally with extra permissions to `yank a release
@ -345,10 +345,11 @@ issuing **multiple releases**, repeat these steps for each release.
<2719a7f8c161233f45d34b624a9df9392c86cc1b>`).
#. If this is a pre-release package also update the "Development Status"
trove classifier in ``setup.cfg`` to reflect this. An ``rc`` pre-release
should not change the trove classifier (:commit:`example commit for alpha
release <eeeacc52a967234e920c001b7908c4acdfd7a848>`, :commit:`example
commit for beta release <25fec8940b24107e21314ab6616e18ce8dec1c1c>`).
trove classifier in ``pyproject.toml`` to reflect this. An ``rc``
pre-release should not change the trove classifier (:commit:`example
commit for alpha release <eeeacc52a967234e920c001b7908c4acdfd7a848>`,
:commit:`example commit for beta release
<25fec8940b24107e21314ab6616e18ce8dec1c1c>`).
#. Otherwise, make sure the classifier is set to
``Development Status :: 5 - Production/Stable``.
@ -370,8 +371,8 @@ issuing **multiple releases**, repeat these steps for each release.
#. Make sure you have an absolutely clean tree by running ``git clean -dfx``.
#. Run ``make -f extras/Makefile`` to generate the release packages. This will
create the release packages in a ``dist/`` directory.
#. Run ``python -m build`` to generate the release packages. This will create
the release packages in a ``dist/`` directory.
#. Generate the hashes of the release packages: