Debian's pybuild system fails to build our python package:
E: pybuild pybuild:147: cannot detect build system, please use
--system option or set PYBUILD_SYSTEM env. variable
It doesn't fall back to setuptools anymore by default and requires
an explicit build system definition or forced build system via
command line options or environment variables.
We could work around that by setting PYBUILD_SYSTEM in the debian
rules, but the real fix is to provide a minimal pyproject.toml that
would point tools to the right build system. It is a better
solution as it is not limited to pybuild, but will help any other
similar tools as well.
Nothing except for the build system is specified in the added
pyproject.toml on purpose. Our setup.py handles the C extension
building that is not really possible to do in a declarative way.
Moving metadata from setup.py into pyproject.toml would require
creating a custom build backend script that would handle extension
building, which doesn't make a lot of sense at this time. And we
should not split metadata across multiple files. So, everything
stays where it is for now.
Reported-at: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1126096
Signed-off-by: Ilya Maximets <[email protected]>
---
python/automake.mk | 4 +++-
python/pyproject.toml | 3 +++
2 files changed, 6 insertions(+), 1 deletion(-)
create mode 100644 python/pyproject.toml
diff --git a/python/automake.mk b/python/automake.mk
index d2589e6fe..c3e960c82 100644
--- a/python/automake.mk
+++ b/python/automake.mk
@@ -81,6 +81,7 @@ EXTRA_DIST += \
EXTRA_DIST += \
python/ovs/compat/sortedcontainers/LICENSE \
python/ovs/flowviz/ovs-flowviz.conf \
+ python/pyproject.toml \
python/README.rst \
python/setup.py \
python/test_requirements.txt
@@ -123,7 +124,8 @@ ovs-install-data-local:
rm python/ovs/dirs.py.tmp
.PHONY: python-sdist
-python-sdist: $(srcdir)/python/ovs/version.py $(ovs_pyfiles)
python/ovs/dirs.py python/setup.py
+python-sdist: $(srcdir)/python/ovs/version.py $(ovs_pyfiles)
python/ovs/dirs.py \
+ python/setup.py python/pyproject.toml
cd python/ && $(PYTHON3) -m build --sdist
.PHONY: pypi-upload
diff --git a/python/pyproject.toml b/python/pyproject.toml
new file mode 100644
index 000000000..fed528d4a
--- /dev/null
+++ b/python/pyproject.toml
@@ -0,0 +1,3 @@
+[build-system]
+requires = ["setuptools"]
+build-backend = "setuptools.build_meta"
--
2.54.0
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev