-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Config: build.tools.python
has to be a string to avoid confusions
#9719
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
Comments
Playing the guessing game, I could see it not allowing a float (the fix could be quoting it as |
Aha! So it did want an explicitly quoted string. Why not just say that in an error message? |
It seems that you find the problem yourself by adding quotes to the Python version. I agree the error message can be improved. Actually, I thought we had an issue about this, but I didn't find it now. |
I had this suggestion about this "problem" #8696 (comment). |
I think it'd be reasonable to explicitly mention that the config value got parsed as a float and an explicit YAML string is expected. |
Here's an idea: make a JSON schema published to SchemaStore. This would allow people to lint it in CI using https://github.com/python-jsonschema/check-jsonschema.git, plus many code editors would make use of it for autocomple. And finally, you could use the very same schema in RTD, making sure that it's the same for everyone. |
@webknjaz we already have one https://docs.readthedocs.io/en/stable/config-file/v2.html#schema, and we are already on schemastore. There is an open issue to use it to validate the config file on the server #8549. |
build.tools.python
has to be a string to avoid confusions
At this point we could pass what's the expected data type to readthedocs.org/readthedocs/config/config.py Lines 857 to 860 in 3ba5cbb
|
In general, yaml is not strictly typed format and configs should accept unquoted numbers in places where only strings are allowed. Examples are Github Actions, Ansible, ... If the RTD parser does not follow schema directly and parses the yaml context-free, it should not be that hard to post-process the parsed data based on the schema, ie. cast the types to based on the schema. |
(with my Ansible Core Dev hat on) @mvorisek it's not that simple. During parsing, the information about the initial input is lost (unless a custom parser is used). So an unquoted ambiguous |
I will close this issue since I think the new notification is clear enough. However, feel free to re-open or comment here if you consider there is anything else we can do to make it clearer. |
With #11081 "latest" is supported. |
Details
RTD build page presents an error message that doesn't make sense.
https://readthedocs.org/projects/tomlkit-webknjazs-fork/builds/18577928/
Expected Result
Build should start.
Actual Result
It didn't. Instead, it errored out with a banner saying:
(emphasis mine)
The message says that
3.11
is not a valid version and lists3.11
among valid versions. That is confusing. Also, the docs page at https://docs.readthedocs.io/en/stable/config-file/v2.html#sphinx-configuration says3.11
is allowed.The config file used:
The text was updated successfully, but these errors were encountered: