-
Notifications
You must be signed in to change notification settings - Fork 843
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
Generate documentation of private members through sphinx docs #2831
Generate documentation of private members through sphinx docs #2831
Conversation
Pull Request Test Coverage Report for Build 5964715633
💛 - Coveralls |
what's with the Tests / docs step failing here? |
I expect sphinx wasn't parsing the private methods at all before so didn't detect formatting problems. I'll take a look. |
@@ -257,7 +257,7 @@ def __init__(self, configfile: str, | |||
|
|||
* file or directory path passed as command-line argument (*configfile*), if it exists and the file or | |||
files found in the directory can be parsed (see :meth:`~Config._load_config_path`), otherwise | |||
* YAML file passed via the environment variable (see :cvar:`PATRONI_CONFIG_VARIABLE`), if the referenced | |||
* YAML file passed via the environment variable (see :attr:`PATRONI_CONFIG_VARIABLE`), if the referenced |
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.
Hmm, in the class docstring it is declared as :cvar:
. Shouldn't it be here the same?
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.
Apparently, it's not a valid "domain" according to sphinx command output. Docs are here for what can be used
https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#cross-referencing-python-objects
patroni/postgresql/validator.py
Outdated
Load validators from YAML files that were found. | ||
|
||
Recursively walk through ``available_parameters`` directory and load validators of each found YAML file into | ||
``parameters`` and/or ``recovery_parameters`` variables. | ||
|
||
Walk through directories in top-down fashion and for each of them: | ||
* Sort files by name; | ||
* Load validators from YAML files that were found. |
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 an expected change?
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.
Hmmn yes that is odd. Let me revert it and see if there were errors.
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.
Yep, unrelated. Reverted.
With this commit we make sphinx build API docs for the following things, which were missing up to this point: * `__init__` method of classes; * "private" members (properties, functions, methods, attributes, etc., which name starts with an underscore); * members that are missing a docstring, so we can still reference them with links in the documentation. The third point can be removed later, if we wish, when we reach a point where everything has proper docstrings in the Patroni code base. References: PAT-195. Signed-off-by: Israel Barth Rubio <[email protected]>
…hinx * `:cvar:` is not a valid domain role. Replaced with `:attr:`. * documentation for `consul.base.Consul.__init__` has a single backtick quoted string which is interpreted as a reference which cannot be found. Therefore, the docstring has been copied as a block quote. * various list spacing problems and indentation problems. * code blocks added where indentation is interpreted incorrectly * literal string quoting issues.
78a4b15
to
1e38a7a
Compare
👍 |
1 similar comment
👍 |
With this commit we make sphinx build API docs for the following things, which were missing up to this point:
__init__
method of classes;The third point can be removed later, if we wish, when we reach a point where everything has proper docstrings in the Patroni code base.
References: PAT-195.