build: eliminate "python setup.py ..."
commit2c3f95c108394bb41f541cac816eddcb2777efd3
authorDavid Aguilar <davvid@gmail.com>
Thu, 10 Mar 2022 17:36:38 +0000 (10 09:36 -0800)
committerDavid Aguilar <davvid@gmail.com>
Thu, 10 Mar 2022 17:40:32 +0000 (10 09:40 -0800)
tree8fcdd86ae0af755a8dc5c49e5b15b903acc6330e
parentbcbc5599816a4759fb622e60551316288d68839b
build: eliminate "python setup.py ..."

Stop supporting "python setup.py {build,build_pot,build_mo,install}".
Handle "make i18n" using the Makefile directly to simplify our
dependencies.

Stop requiring files that are generated at build-time. Git Cola
no longer depends on generated files.

Eliminate our dependency on the .mo files and the distutils.commands
entry points, which are problem due to the deprecation of distutils.

We were doing underhanded things like hooking into the sub_commands
in the core setuptools.command.build.build class, which was fragile
and did not fully support PEP-517/518 compatible build tools.

Furthermore, we were dependent on data_files to install our
generated .mo translation files, and there is no current supported
method to force "python -m build" or "pip install" to run the .mo
generation step during the build.

The Python Packaging Authority (PyPA) strongly recommends that *all*
data required by the package should be shipped as "package_data".

Now that we are using polib we can simply install our .po files
directly into the cola package data and read them directly.
There is no need to ship binary .mo files or deal with the
complexity around them.

Related Links:

* https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html
* https://pypa-build.readthedocs.io/en/stable/installation.html
* https://setuptools.pypa.io/en/latest/userguide/datafiles.html

Closes #1201
Signed-off-by: David Aguilar <davvid@gmail.com>
13 files changed:
.github/workflows/main.yml
CHANGES.rst
Makefile
README.md
bin/README.md
cola/i18n.py
extras/__init__.py [deleted file]
extras/build.py [deleted file]
extras/build_mo.py [deleted file]
extras/build_pot.py [deleted file]
extras/build_util.py [deleted file]
extras/install.py [deleted file]
setup.cfg