Skip to content

DOC: Suppress distutils doc build warnings for python 3.12+ #29160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bmwoodruff
Copy link
Member

Enables an error free build of the docs for python 3.12+. Excludes related files, supresses all warnings for excluded files, and ignores case-by-case individual references. Closes #29131.

[skip azp][skip cirrus][skip actions]

Enables an error free build of the docs for python 3.12+.
Excludes related files, supresses all warnings for excluded files,
and ignores case-by-case individual references. Closes numpy#29131.

[skip azp][skip cirrus][skip actions]
Comment on lines +161 to +163
suppress_warnings += [
'toc.excluded', # Suppress warnings about excluded toctree entries
]
Copy link
Member Author

Choose a reason for hiding this comment

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

This bit is my only concern, as it suppresses ALL toc.excluded warnings. The Sphinx documentation related to this warning is a bit sparse, so I'm not sure how greedy this suppression will be. If it only suppresses the files explicitly listed above (the two we want excluded), then I'm happy with this fix.

I've tried using the only and ifconfig directives to deal conditional toctree inclusions, but that route will fail because the toctree is read before any conditional statements are applied.

Copy link
Member Author

Choose a reason for hiding this comment

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

Tracing the code relate to toc.excluded, I inclined to think the global suppression of toc.excluded will be safe (only suppress warnings to thing that have manually been excluded already).

On another note, should we worry about the "/" in "reference/distutils.rst" and "reference/distutils/misc_util.rst"? This seems like it could cause Windows doc build issues. I just followed the existing "reference/distutils.rst" when adding another line, but now I'm concerned it will cause windows doc builds to fail. I don't have a working Windows environment to test a doc build on. Thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

When is the np.distutils removal going to happen? I think this is fine as a temporary solution until then.

@bmwoodruff bmwoodruff marked this pull request as ready for review June 10, 2025 00:31
@bmwoodruff
Copy link
Member Author

The tests do not cover testing a new codespaces doc build. I tested buliding the docs using this branch on a new codespaces as well as a virtual machine (in windows 11) running Ubuntu 24.04 after creating a fresh conda environment from environment.yml. I have not tested building the docs on mac or windows.

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.

DOC: Spin docs gives errors (distutils) on new codespaces (because python 3.12 in environment.yml)
2 participants