[PATCH nft 3/3] py: add pyproject.toml to support PEP-517-compatible build-systems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This makes it possible to build and install the module without directly
invoking setup.py which has been deprecated.

Retain the setup.py script for backwards-compatibility.

Update INSTALL to mention the new config-file.

Link: https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html
Signed-off-by: Jeremy Sowden <jeremy@xxxxxxxxxx>
---
 INSTALL           | 3 ++-
 py/Makefile.am    | 2 +-
 py/pyproject.toml | 3 +++
 3 files changed, 6 insertions(+), 2 deletions(-)
 create mode 100644 py/pyproject.toml

diff --git a/INSTALL b/INSTALL
index 9b626745d7a4..53021e5aafc3 100644
--- a/INSTALL
+++ b/INSTALL
@@ -86,7 +86,8 @@ Installation instructions for nftables
 
  CPython bindings are available for nftables under the py/ folder.
 
- setup.py is provided to install it.
+ A pyproject.toml config file and legacy setup.py script are provided to install
+ it.
 
  Source code
  ===========
diff --git a/py/Makefile.am b/py/Makefile.am
index 974539fd44ad..76aa082f8709 100644
--- a/py/Makefile.am
+++ b/py/Makefile.am
@@ -1 +1 @@
-EXTRA_DIST = setup.cfg setup.py src
+EXTRA_DIST = pyproject.toml setup.cfg setup.py src
diff --git a/py/pyproject.toml b/py/pyproject.toml
new file mode 100644
index 000000000000..fed528d4a7a1
--- /dev/null
+++ b/py/pyproject.toml
@@ -0,0 +1,3 @@
+[build-system]
+requires = ["setuptools"]
+build-backend = "setuptools.build_meta"
-- 
2.40.1




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux