Use setuptools instead of distutils for packaging
commitf476a8823438e251a20aa3809f8ca0dfe4ed6af8
authorPeter Grayson <pete@jpgrayson.net>
Sun, 29 Aug 2021 12:14:21 +0000 (29 08:14 -0400)
committerPeter Grayson <pete@jpgrayson.net>
Tue, 31 Aug 2021 01:34:32 +0000 (30 21:34 -0400)
treee57563a706a458fd4f0fad3b932a5d0ee08daa66
parent9e2679310ae62eccf13084efcf7696be51629e87
Use setuptools instead of distutils for packaging

PEP-632 deprecates the distutils package and establishes a timeline for its
eventual removal from the Python standard library. This PEP also identifies
setuptools as the appropriate alternative solution for distributing Python
code.

The presence of a pyproject.toml file, which already exists for stgit,
identifies stgit as a PEP-518 enabled project. This means that stgit's
build-time dependencies (setuptools and wheel) are enumerated in
pyproject.toml.

Some notes:

- setup.py is no longer executable. The conventional way to run setup.py is
  by explicitly calling it with the python interpreter of choice. I.e. with
  `python setup.py ...`.

- The python_requires metadata, which is supported by setuptools, allows
  stgit to specify its minimum required python version. This is an
  opportunity to obviate stgit's other minimum python version specification
  and checking. I.e. the minimum python version will now be enforced at
  package installation time instead of runtime.

- The zip_safe=False option is used to indicate that stgit cannot be
  installed in zip form. This is needed because stgit has "data files" in
  the package (specifically, .tmpl files) that need to be accessible at
  runtime.

- Removed umask manipulation which seems to have been voodoo remaining from
  ages past.

Signed-off-by: Peter Grayson <pete@jpgrayson.net>
.gitignore
Makefile
pyproject.toml
setup.py [changed mode: 0755->0644]