Skip to content

GH-49503: [Docs][Python] Documenting .pxi doctests are tested via lib.pyx#49515

Open
bhavanaeh wants to merge 1 commit intoapache:mainfrom
bhavanaeh:docs-pxi-doctest-info
Open

GH-49503: [Docs][Python] Documenting .pxi doctests are tested via lib.pyx#49515
bhavanaeh wants to merge 1 commit intoapache:mainfrom
bhavanaeh:docs-pxi-doctest-info

Conversation

@bhavanaeh
Copy link

@bhavanaeh bhavanaeh commented Mar 15, 2026

Rationale for this change

Running python -m pytest --doctest-cython directly on .pxi files doesn't work because Cython .pxi files are included in .pyx files at compile time. This isn't documented, which could potentially confuse contributors.

Please see discussion in #49279 (comment) by @AlenkaF for additional context.

What changes are included in this PR?

Added a note to the Doctest section of the Developing PyArrow documentation explaining that:

  • .pxi files cannot be tested directly with --doctest-cython
  • Doctests should be run on the .pyx file they are included in (e.g., lib.pyx)
  • Errors will appear under the .pyx file, not the original .pxi filename

Are these changes tested?

Documentation-only change. No code changes.

Are there any user-facing changes?

No.

@github-actions
Copy link

⚠️ GitHub issue #49503 has been automatically assigned in GitHub to PR creator.

for ``.pyx`` and ``.pxi`` files. In this case you will also need to
install the `pytest-cython <https://github.com/lgpage/pytest-cython>`_ plugin.

.. note::
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went with a .. note:: block to make this stand out, but happy to change it to inline text if that's preferred.

@bhavanaeh bhavanaeh changed the title GH-49503: [Python][Doc] Documenting .pxi doctests are tested via lib.pyx GH-49503: [Docs][Python] Documenting .pxi doctests are tested via lib.pyx Mar 15, 2026
@github-actions
Copy link

⚠️ GitHub issue #49503 has been automatically assigned in GitHub to PR creator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant