-
Notifications
You must be signed in to change notification settings - Fork 8
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
Backport documentation generation to v0.10.x #35
Backport documentation generation to v0.10.x #35
Conversation
Signed-off-by: Leandro Lucarella <leandro.lucarella@frequenz.com>
Signed-off-by: Leandro Lucarella <leandro.lucarella@frequenz.com>
The documentation is generated using MkDocs, using the Material theme plus mkdocstrings (and a few minor supporting extensions) to build the API documentation extracted from code comments. For now the home page is a place holder, and the supporting script `docs/mkdocstrings-autoapi.py` should eventually be moved to a common repository. Signed-off-by: Leandro Lucarella <leandro.lucarella@frequenz.com>
When generating the documentation, the License and Copyright text appears on every module. It might be confusing for users if the license applies to the code or the documentation. This commit just moves the copyright notice and license specification as a regular comment instead of putting it into the docstring that gets rendered as documentation. This was automatically adjusted using: ```sh find -name '*.py' -not -path './.*' \ | xargs sed -i '1 i\# License: MIT\n# Copyright © 2022 Frequenz Energy-as-a-Service GmbH\n' find -name '*.py' -not -path './.*' \ | xargs sed -zi 's/\n\?\(Copyright\|License\)\n[^\n]*\n\n\?//g' ``` Signed-off-by: Leandro Lucarella <leandro.lucarella@frequenz.com>
Signed-off-by: Leandro Lucarella <leandro.lucarella@frequenz.com>
Signed-off-by: Leandro Lucarella <leandro.lucarella@frequenz.com>
This is needed to get them properly rendered and in a collapsable way. Signed-off-by: Leandro Lucarella <leandro.lucarella@frequenz.com>
Besides improving code legibility, they are necessary for the rendered documentation to be properly cross-referenced (otherwise the types appear just as a string, without links). Signed-off-by: Leandro Lucarella <leandro.lucarella@frequenz.com>
Then "Returns:" uses more than one line, it should be indented one level more to mark the continuation of one return specification, as it is possible to have multiple return specifications. Signed-off-by: Leandro Lucarella <leandro.lucarella@frequenz.com>
Signed-off-by: Leandro Lucarella <leandro.lucarella@frequenz.com>
A few comments are rephrased or added or removed in the hopes to make the documentation more reable or easier to understand. Signed-off-by: Leandro Lucarella <leandro.lucarella@frequenz.com>
mike is a tool to keep several versions of a MkDocs site. Please see the project documentation for more info: https://github.com/jimporter/mike Signed-off-by: Leandro Lucarella <leandro.lucarella@frequenz.com>
Signed-off-by: Leandro Lucarella <leandro.lucarella@frequenz.com>
For pull requests the documentation is built and uploaded as an artifact, so it can be manually checked. For pushes, the documentation is built and published. When pushing to a branch, if it is the default branch, then the published version is called "next". At some point we might want to consider having multiple vMAJOR.MINOR-dev documentation generated, but will come when/if we have multiple vMAJOR.MINOR being maintained. For now if a branch other than the default branch is pused to, nothing will be published. When pushing a new tag, if it is a pre-release tag (includes a `-`), then the documentation is not published (again it could be published once we have vMAJOR.MINOR-dev versions of the documentation). Otherwise the documentation is published with version vMAJOR.MINOR and a vMAJOR alias is added. If the MAJOR is the same as the default branch, a "latest" alias is added/updated to that version too. Signed-off-by: Leandro Lucarella <leandro.lucarella@frequenz.com>
Also fix issues found while running the linting. Signed-off-by: Leandro Lucarella <leandro.lucarella@frequenz.com>
There is no reason to ignore imports, that only makes checking the types weaker. To be able to check types in a more strict way, we need to use packages (-p) to avoid errors about having the same file in 2 packages (src.frequenz.channels and frequenz.channels), so we need to translate directory to package when running on `src`. Also we need to check individual files separately. Signed-off-by: Leandro Lucarella <leandro.lucarella@frequenz.com>
Without this permissions the job can't publish GitHub Pages. Signed-off-by: Leandro Lucarella <leandro.lucarella@frequenz.com>
Does this push to the |
Yes, this is what Then it uses aliases for versions. I'm using
|
FYI one check is missing because we didn't support Python 3.11-dev in v0.10.x, I don't think it is worth changing. Maybe we can add a dummy ci job that depends on all the tests we want the PRs to pass and only have that job as a requirement for PRs, so this doesn't happen while we add/remove python versions... |
we also need to switch to the stable version of 3.11, now that it has been released. |
Yeah, I was planning to do so after all this. |
See #25 for details.