-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[docs] clarify why add_config_value throws a type mismatch warning if type argument is omitted #11779
Comments
Heya If you want to allow your users to provide either a string or a app.add_config_value("myextension_data_path", app.srcdir, "html", types=[str, Path]) |
@chrisjsewell : Undestood, but my point is, that if the |
I think you may be missreading this; the |
Thanks for clarification, @chrisjsewell . I think the documentation should be extended by a note like this: If |
PR for updating the doc is welcomed ! I'll leave the issue opened so that we know of one example. |
Describe the bug
Our custom extensions, which define config values for strings (actually path-strings) like shown below, fail to load when I switch from sphinx 6.1 to 7.2.6, with the following warning:
The extension's setup function looks like this:
According to the docs, the types argument defaults to "Any", which I'd expect to mean that it accepts any type.
I saw some other people on the internet stumble upon this, and helped themselves like this:
scikit-hep/pyhf#2300
I've helped myself like this:
What also works is this:
But both seem to me to be inconsistent with the documentation.
In any case, this seems to me to be an incompatible change between sphinx 6 and 7 that I could not find in the changelog. Please help me understand the rationale behind this.
How to Reproduce
I will provide a minimal example extension if you want.
Environment Information
Sphinx extensions
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: