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>