From ecff1a16981cf2600ad402a6b8eb695ad6f44548 Mon Sep 17 00:00:00 2001 From: Bhavana Sundar Date: Sun, 15 Mar 2026 11:14:21 -0700 Subject: [PATCH 1/3] GH-49503: [Python][Doc] Document that .pxi doctests are tested via lib.pyx --- docs/source/developers/python/development.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/source/developers/python/development.rst b/docs/source/developers/python/development.rst index 5757b761875a..53fdc5b923a8 100644 --- a/docs/source/developers/python/development.rst +++ b/docs/source/developers/python/development.rst @@ -195,6 +195,17 @@ for ``.py`` files or for ``.pyx`` and ``.pxi`` files. In this case you will also need to install the `pytest-cython `_ plugin. +.. note:: + Cython ``.pxi`` files are included in ``.pyx`` files at compile time, + so ``--doctest-cython`` cannot be run directly on ``.pxi`` files. + Instead, run doctests on the ``.pyx`` file they are included in, for + example ``lib.pyx``:: + + $ python -m pytest --doctest-cython pyarrow/lib.pyx + + Any doctest errors originating from ``.pxi`` files will appear under + the corresponding ``.pyx`` file, not the original ``.pxi`` filename. + Testing Documentation Examples ------------------------------- From ce75da84b0f98e685b8ef0dc8de96a5ec614b3da Mon Sep 17 00:00:00 2001 From: Bhavana Sundar Date: Thu, 19 Mar 2026 20:50:50 -0700 Subject: [PATCH 2/3] docs: clarifying all .pxi files are included into lib.pyx --- docs/source/developers/python/development.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/developers/python/development.rst b/docs/source/developers/python/development.rst index 53fdc5b923a8..c7c3478ecd83 100644 --- a/docs/source/developers/python/development.rst +++ b/docs/source/developers/python/development.rst @@ -198,13 +198,13 @@ install the `pytest-cython `_ plugin. .. note:: Cython ``.pxi`` files are included in ``.pyx`` files at compile time, so ``--doctest-cython`` cannot be run directly on ``.pxi`` files. - Instead, run doctests on the ``.pyx`` file they are included in, for - example ``lib.pyx``:: + In PyArrow, all ``.pxi`` files are included into ``lib.pyx``, so run + doctests on that file:: $ python -m pytest --doctest-cython pyarrow/lib.pyx Any doctest errors originating from ``.pxi`` files will appear under - the corresponding ``.pyx`` file, not the original ``.pxi`` filename. + ``lib.pyx``, not the original ``.pxi`` filename. Testing Documentation Examples ------------------------------- From cacc0bc9da34e511e2c56a66d39ea97d45e25b0c Mon Sep 17 00:00:00 2001 From: Alenka Frim Date: Fri, 20 Mar 2026 16:36:05 +0100 Subject: [PATCH 3/3] Update docs/source/developers/python/development.rst --- docs/source/developers/python/development.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/developers/python/development.rst b/docs/source/developers/python/development.rst index c7c3478ecd83..e70fb4430757 100644 --- a/docs/source/developers/python/development.rst +++ b/docs/source/developers/python/development.rst @@ -201,7 +201,7 @@ install the `pytest-cython `_ plugin. In PyArrow, all ``.pxi`` files are included into ``lib.pyx``, so run doctests on that file:: - $ python -m pytest --doctest-cython pyarrow/lib.pyx + $ python -m pytest --doctest-cython path/to/lib.pyx Any doctest errors originating from ``.pxi`` files will appear under ``lib.pyx``, not the original ``.pxi`` filename.