-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add support for YAML data files in load_data [RHELDST-4904] #21
Add support for YAML data files in load_data [RHELDST-4904] #21
Conversation
34e906f
to
5544c7f
Compare
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.
Only complaint is about adding the pathlib dep.
The load_data method will accept both YAML and JSON files, but will load the data.yaml file by default. This change enables cdn-definitions-private to cease maintaining two sets of data, in both YAML and JSON forms -- only data.yaml files will be provided and maintained. Those who wish to use the cdn-definitions-private data will be able to do so without a manual conversion of the YAML data file into a JSON file.
5544c7f
to
44045c5
Compare
@@ -43,15 +49,15 @@ def __init__(self, **kwargs): | |||
|
|||
def rhui_aliases(): | |||
"""Returns: | |||
list[:class:`~PathAlias`] | |||
A list of aliases relating to RHUI paths. | |||
list[:class:`~PathAlias`] |
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.
Have you verified that this displays correctly on the rendered docs?
The indent in general is meaningful. This commit is changing the string from:
Returns:
list[:class:`~PathAlias`]
A list of aliases relating to RHUI paths.
to:
Returns:
list[:class:`~PathAlias`]
A list of aliases relating to RHUI paths.
Doc strings are processed via this tool: https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html
And in the examples there you can see that the docs for return value are always indented under "Returns", so I have a doubt whether this change is correct.
I'm not sure if the doc string parser is still going to process this the same way as it did before...
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.
Is it black
tool reformatting this?
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 see now there's a separate commit in the PR saying that it's coming from black.
I checked this locally and I'm a bit confused actually, as both before and after this change sphinx generates warnings:
/home/rmcgover/src/cdn-definitions/.tox/docs/lib/python3.8/site-packages/cdn_definitions/_impl/__init__.py:docstring of cdn_definitions._impl.rhui_aliases:3: WARNING: Unexpected indentation.
/home/rmcgover/src/cdn-definitions/.tox/docs/lib/python3.8/site-packages/cdn_definitions/_impl/__init__.py:docstring of cdn_definitions._impl.origin_aliases:3: WARNING: Unexpected indentation.
So maybe it was not correct either before or after? However, the rendered docs seem OK to me, so no objections to this.
The load_data method will accept both YAML and JSON files, but will
load the data.yaml file by default.
This change enables cdn-definitions-private to cease maintaining
two sets of data, in both YAML and JSON forms -- only data.yaml
files will be provided and maintained. Those who wish to use
the cdn-definitions-private data will be able to do so without
a manual conversion of the YAML data file into a JSON file.