Skip to content

TST/DOC: set up doctesting - #921

Open
fbourgey wants to merge 2 commits into
data-apis:mainfrom
fbourgey:doctest
Open

TST/DOC: set up doctesting#921
fbourgey wants to merge 2 commits into
data-apis:mainfrom
fbourgey:doctest

Conversation

@fbourgey

Copy link
Copy Markdown
Contributor

Closes #397

This PR tries to set up doctesting using scipy_doctest. I had to fixed a couple of doc examples for pixi run doctests to pass.

I worked with Codex on this, notably the conftest.py.

@fbourgey
fbourgey marked this pull request as draft August 13, 2026 18:00
@fbourgey
fbourgey marked this pull request as ready for review August 13, 2026 18:12
@fbourgey

Copy link
Copy Markdown
Contributor Author

cc @lucascolley

@lucascolley
lucascolley self-requested a review August 13, 2026 20:32
@lucascolley lucascolley added DX testing documentation Improvements or additions to documentation labels Aug 14, 2026
@lucascolley lucascolley changed the title DEV: set up doctesting TST/DOC: set up doctesting Aug 14, 2026
@lucascolley lucascolley removed the DX label Aug 14, 2026
@lucascolley lucascolley added this to the 0.11.2 milestone Aug 14, 2026
@lucascolley

Copy link
Copy Markdown
Member

aha, thanks for working on this! There are some merge conflicts now, sorry, bad timing with a big refactor. Let me know if you have any trouble resolving them.

@lucascolley
lucascolley removed their request for review August 15, 2026 15:14
Comment thread src/array_api_extra/_at.py
@fbourgey
fbourgey force-pushed the doctest branch 2 times, most recently from 484ca6e to 7ad199d Compare August 17, 2026 18:07
@fbourgey

Copy link
Copy Markdown
Contributor Author

aha, thanks for working on this! There are some merge conflicts now, sorry, bad timing with a big refactor. Let me know if you have any trouble resolving them.

@lucascolley I think the conflicts are fixed now.

@lucascolley lucascolley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks Florian, this is awesome!

Comment thread .github/workflows/ci.yml Outdated
environments: tests

- name: Test public API examples
run: pixi run -e tests doctests

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

unnecessary thanks to default-environment

Suggested change
run: pixi run -e tests doctests
run: pixi run doctests

Comment thread docs/sphinx/contributing.md Outdated
```bash
pixi run tests # run the tests
pixi run open-docs # build and preview the docs
pixi run doctests # run the doctests in the docs

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
pixi run doctests # run the doctests in the docs
pixi run doctests # test docs examples

Comment thread src/array_api_extra/_at.py
Comment thread conftest.py

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@ev-br please could you confirm that this file looks good?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, scipy-doctest configuration in conftests.py looks good!

Comment thread conftest.py Outdated
@@ -0,0 +1,28 @@
"""Configure public API doctests."""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That's all the file is doing now, but it isn't the purpose of the file in general.

Suggested change
"""Configure public API doctests."""
"""Configure pytest."""

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

Labels

documentation Improvements or additions to documentation testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DOC/TST: Add some form of doctesting

3 participants