]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind: add pyproject.toml to fix ReadTheDocs builds with pip 25.3+ 66966/head
authorKefu Chai <k.chai@proxmox.com>
Mon, 19 Jan 2026 11:19:56 +0000 (19:19 +0800)
committerKefu Chai <k.chai@proxmox.com>
Thu, 22 Jan 2026 06:12:49 +0000 (14:12 +0800)
ReadTheDocs builds started failing when pip 25.3 began enforcing PEP 517
build isolation. Under build isolation, pip creates a clean temporary
environment to build packages. Without pyproject.toml declaring build
dependencies, Cython is not available in this isolated environment,
causing builds to fail.

Error from failing builds:
  Processing ./src/pybind/rados
    Getting requirements to build wheel: finished with status 'error'
    × Getting requirements to build wheel did not run successfully.
    │ exit code: 1
    ╰─> [2 lines of output]
        ERROR: Cannot find Cythonized file rados.c
        WARNING: Cython is not installed.

pip 25.3 removed the --no-use-pep517 option and no longer calls
setup.py bdist_wheel, enforcing PEP 517 build isolation by default.
Without pyproject.toml, pip cannot install Cython in the isolated
build environment, preventing the generation of .c files from .pyx
sources during the build.

This commit adds pyproject.toml to all four pybind modules (rados,
cephfs, rbd, rgw) declaring Cython>=0.29 as a build dependency. This
ensures Cython is available in pip 25.3's isolated build environment,
allowing the build to proceed successfully.

How it works:
  ReadTheDocs builds pybind modules by running:
    pip install -r admin/doc-pybind.txt

  This file lists local directory paths:
    src/pybind/rados
    src/pybind/cephfs
    src/pybind/rbd
    src/pybind/rgw

  When pip processes each local directory, it automatically:
  1. Looks for pyproject.toml in that directory (per PEP 517/518)
  2. Reads the [build-system] section
  3. Installs the dependencies listed in "requires" into an isolated
     build environment
  4. Invokes the build backend (setup.py via setuptools.build_meta)

  With pyproject.toml present, Cython is now installed in step 3,
  making it available when setup.py runs in step 4.

References:
- pip 25.3 Changelog: https://pip.pypa.io/en/stable/news/
- pip Issue: https://github.com/pypa/pip/issues/6334
- PEP 517 (Build System Interface): https://peps.python.org/pep-0517/
- PEP 518 (Build System Requirements): https://peps.python.org/pep-0518/

Signed-off-by: Kefu Chai <k.chai@proxmox.com>
src/pybind/cephfs/pyproject.toml [new file with mode: 0644]
src/pybind/rados/pyproject.toml [new file with mode: 0644]
src/pybind/rbd/pyproject.toml [new file with mode: 0644]
src/pybind/rgw/pyproject.toml [new file with mode: 0644]

diff --git a/src/pybind/cephfs/pyproject.toml b/src/pybind/cephfs/pyproject.toml
new file mode 100644 (file)
index 0000000..2bf5ec8
--- /dev/null
@@ -0,0 +1,3 @@
+[build-system]
+requires = ["setuptools", "wheel", "Cython"]
+build-backend = "setuptools.build_meta"
diff --git a/src/pybind/rados/pyproject.toml b/src/pybind/rados/pyproject.toml
new file mode 100644 (file)
index 0000000..2bf5ec8
--- /dev/null
@@ -0,0 +1,3 @@
+[build-system]
+requires = ["setuptools", "wheel", "Cython"]
+build-backend = "setuptools.build_meta"
diff --git a/src/pybind/rbd/pyproject.toml b/src/pybind/rbd/pyproject.toml
new file mode 100644 (file)
index 0000000..2bf5ec8
--- /dev/null
@@ -0,0 +1,3 @@
+[build-system]
+requires = ["setuptools", "wheel", "Cython"]
+build-backend = "setuptools.build_meta"
diff --git a/src/pybind/rgw/pyproject.toml b/src/pybind/rgw/pyproject.toml
new file mode 100644 (file)
index 0000000..2bf5ec8
--- /dev/null
@@ -0,0 +1,3 @@
+[build-system]
+requires = ["setuptools", "wheel", "Cython"]
+build-backend = "setuptools.build_meta"