-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Add schema for yaml configuration file #4079
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
Conversation
By the way, I think that maybe we could use this to validate the current version too, so we don't have separate code for v1 and v2. Also, there are other features to add dependencies between objects, but I haven't added here yet, I wanted to hear your thoughts before continuing :) |
|
||
"version": { | ||
"description": "The version of the spec to use", | ||
"type": "string", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
String just in case we have some experimental versions like "latest"
"type": "array", | ||
"items": { | ||
"type": "string", | ||
"enum": ["htmlzip", "pdf", "epub", "singlehtmllocalmedia"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the singlehtmllocalmedia
option regarding to #3220 (a little long by the way)
}, | ||
|
||
"requirements_file": { | ||
"description": "The path to the requirements file from the root of the project", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't find any format to path
, so we need to validate this on our side (we need to validate that the path exists anyway)
"description": "The Python versions", | ||
"type": "string", | ||
"enum": ["2", "2.7", "3", "3.3", "3.4", "3.5", "3.6"], | ||
"default": "2.7" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Soon this would be 3.6 :)
"enum": ["2", "2.7", "3", "3.3", "3.4", "3.5", "3.6"], | ||
"default": "2.7" | ||
}, | ||
"setup_py_install": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can rename this to setup_install
?
And here is the spec of the scheme I'm using http://json-schema.org/specification-links.html#draft-7 |
@stsewd why did you decide using json schema over yamale? |
Is more standard and reach |
Just noted this on the issue, i think we should stick with python here as well. There is a possibility to make the schema tests into a unit test if we use a python library. Also, instead of hiding this in our doc path, let's bring this into something more top level, or add this as a test fixture |
I'm doing this on other PR #4084 |
This refs to #4058
I wasn't sure of where put this. I justs added the validation scheme based on the current yaml https://docs.readthedocs.io/en/latest/yaml-config.html.
The schema is from http://json-schema.org, there is a js tool to validate the scheme against a yaml file https://github.com/json-schema-everywhere/pajv.
Some additional steps here are: