From 687f64305929c2e116c34c41c6003c275fcb16b2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com>
Date: Tue, 5 Jul 2022 12:15:53 -0400
Subject: [PATCH] build/python: add pyproject.toml

---
 python/CMakeLists.txt | 3 ++-
 python/Makefile.am    | 3 ++-
 python/pyproject.toml | 3 +++
 3 files changed, 7 insertions(+), 2 deletions(-)
 create mode 100644 python/pyproject.toml

diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index 2ce4bdcc..9b263d20 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -3,10 +3,11 @@ set(CURRENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
 set(CURRENT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
 
 configure_file(setup.py.in setup.py)
+configure_file(pyproject.toml pyproject.toml COPYONLY)
 
 add_custom_target(python ALL
     COMMAND python3 setup.py build
-    DEPENDS opendht opendht_cpp.pxd opendht.pyx)
+    DEPENDS opendht opendht_cpp.pxd opendht.pyx pyproject.toml)
 
 install(CODE "execute_process(COMMAND python3 setup.py install --root=\$ENV{DESTDIR}/ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
 if (OPENDHT_TOOLS)
diff --git a/python/Makefile.am b/python/Makefile.am
index 7f256620..98aeed41 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -2,7 +2,8 @@ if USE_CYTHON
 
 noinst_HEADERS = \
 	opendht.pyx \
-	opendht_cpp.pxd
+	opendht_cpp.pxd \
+	pyproject.toml
 
 PYTHON_INSTALL_RECORD = $(builddir)/install_record.txt
 
diff --git a/python/pyproject.toml b/python/pyproject.toml
new file mode 100644
index 00000000..2bf5ec80
--- /dev/null
+++ b/python/pyproject.toml
@@ -0,0 +1,3 @@
+[build-system]
+requires = ["setuptools", "wheel", "Cython"]
+build-backend = "setuptools.build_meta"
-- 
GitLab