mbox series

[nft,0/3] Python Build Modernization

Message ID 20230731114024.2836892-1-jeremy@azazel.net
Headers show
Series Python Build Modernization | expand

Message

Jeremy Sowden July 31, 2023, 11:40 a.m. UTC
Directly invoking setup.py to build and install a Python module is
deprecated:

  https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html

Pablo recently removed the autotooling which did this.  This patch-set
updates the Python build configuration to add support for modern
alternatives while leaving the setup.py script around for users who may
need it.

The approach I have used is described here:

  https://setuptools.pypa.io/en/latest/build_meta.html

We move the setuptools configuration out of setup.py into setup.cfg, and
then add a pyproject.toml configuration file to tell PEP-517 build tools
to use setuptools.

Setuptools also supports putting all its configuration into
pyproject.toml files:

  https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html

However, this is much more recent than its setup.cfg support (2022 vs
2016), which is why I decided to stick with the approach described
above.

Jeremy Sowden (3):
  py: move package source into src directory
  py: use setup.cfg to configure setuptools
  py: add pyproject.toml to support PEP-517-compatible build-systems

 INSTALL                  |  3 ++-
 py/Makefile.am           |  2 +-
 py/pyproject.toml        |  3 +++
 py/setup.cfg             | 24 ++++++++++++++++++++++++
 py/setup.py              | 23 ++---------------------
 py/{ => src}/__init__.py |  0
 py/{ => src}/nftables.py |  0
 py/{ => src}/schema.json |  0
 8 files changed, 32 insertions(+), 23 deletions(-)
 create mode 100644 py/pyproject.toml
 create mode 100644 py/setup.cfg
 rename py/{ => src}/__init__.py (100%)
 rename py/{ => src}/nftables.py (100%)
 rename py/{ => src}/schema.json (100%)

Comments

Pablo Neira Ayuso Aug. 3, 2023, 7:46 a.m. UTC | #1
Series applied, thanks