Skip to content
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 code documentation generated from docstrings #2114

Merged
merged 2 commits into from Nov 16, 2023
Merged

Conversation

happz
Copy link
Collaborator

@happz happz commented May 26, 2023

Adding a new section into "Contribute" page, "Code documentation", and besides the actual code documenation, I propose moving "Classes" page there as well.

@happz happz added the documentation Improvements or additions to documentation label May 26, 2023
@happz happz added this to the 1.25 milestone May 26, 2023
@psss psss modified the milestones: 1.25, 1.26 Jun 20, 2023
@happz happz force-pushed the docs-add-autodocs branch 2 times, most recently from 4d3c3de to 7b4d444 Compare July 21, 2023 10:25
@happz happz marked this pull request as ready for review July 21, 2023 12:50
@happz happz marked this pull request as draft July 24, 2023 08:46
@happz happz modified the milestones: 1.26, 1.27 Jul 24, 2023
@psss
Copy link
Collaborator

psss commented Jul 24, 2023

Seems that sh does not know pushd:

pushd ../ && sphinx-apidoc --force --implicit-namespaces --no-toc -o docs/autodocs tmt && popd
/bin/sh: 1: pushd: not found
make: *** [Makefile:37: autodocs] Error 127
running '/bin/bash -c 'make autodocs''

See the whole build log for details.

@happz
Copy link
Collaborator Author

happz commented Jul 24, 2023

Yeah, I already checked logs, realized I don't have enough time to resolve this, and pushed it out to the next release.

Makefile Outdated Show resolved Hide resolved
@happz happz removed this from the 1.27 milestone Jul 28, 2023
@happz happz force-pushed the docs-add-autodocs branch 2 times, most recently from f54c264 to 051f9f2 Compare October 4, 2023 21:27
@happz happz mentioned this pull request Oct 20, 2023
pyproject.toml Outdated Show resolved Hide resolved
@happz happz marked this pull request as ready for review November 8, 2023 08:43
@happz happz requested a review from janhavlin as a code owner November 8, 2023 08:43
@happz happz added this to the 1.30 milestone Nov 8, 2023
@happz happz force-pushed the docs-add-autodocs branch 2 times, most recently from eeedb12 to 6a1663c Compare November 14, 2023 12:26
@psss
Copy link
Collaborator

psss commented Nov 14, 2023

I'm seeing a bunch of warnings during make docs:

/home/psss/git/tmt/tmt/frameworks/beakerlib.py:docstring of tmt.frameworks.beakerlib.Beakerlib.extract_results:1: WARNING: more than one target found for cross-reference 'Test': tmt.base.Test, tmt.Test
/home/psss/git/tmt/tmt/frameworks/beakerlib.py:docstring of tmt.frameworks.beakerlib.Beakerlib.extract_results:1: WARNING: more than one target found for cross-reference 'Guest': tmt.Guest, tmt.steps.provision.Guest
/home/psss/git/tmt/tmt/frameworks/beakerlib.py:docstring of tmt.frameworks.beakerlib.Beakerlib.get_environment_variables:1: WARNING: more than one target found for cross-reference 'Test': tmt.base.Test, tmt.Test
...

I guess we should remove the Essential Classes section where the duplication happens?

@happz
Copy link
Collaborator Author

happz commented Nov 14, 2023

I'm seeing a bunch of warnings during make docs:

/home/psss/git/tmt/tmt/frameworks/beakerlib.py:docstring of tmt.frameworks.beakerlib.Beakerlib.extract_results:1: WARNING: more than one target found for cross-reference 'Test': tmt.base.Test, tmt.Test
/home/psss/git/tmt/tmt/frameworks/beakerlib.py:docstring of tmt.frameworks.beakerlib.Beakerlib.extract_results:1: WARNING: more than one target found for cross-reference 'Guest': tmt.Guest, tmt.steps.provision.Guest
/home/psss/git/tmt/tmt/frameworks/beakerlib.py:docstring of tmt.frameworks.beakerlib.Beakerlib.get_environment_variables:1: WARNING: more than one target found for cross-reference 'Test': tmt.base.Test, tmt.Test
...

I guess we should remove the Essential Classes section where the duplication happens?

I believe this is caused by from tmt.base import Test in tmt/__init__.py. That act introduces tmt.Test name, and when Sphinx comes across Test type annotation, it's not clear whether it's tmt.Test or tmt.base.Test.

I tried to address a couple of these, but more work is needed.

Copy link
Collaborator

@psss psss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for enabling this, looks very nice! Would be nice to get rid of the warnings. Otherwise just two minor issues.

plans/install/docs.fmf Outdated Show resolved Hide resolved
tmt/steps/discover/fmf.py Outdated Show resolved Hide resolved
tmt/steps/discover/fmf.py Show resolved Hide resolved
@psss
Copy link
Collaborator

psss commented Nov 14, 2023

I believe this is caused by from tmt.base import Test in tmt/__init__.py. That act introduces tmt.Test name, and when Sphinx comes across Test type annotation, it's not clear whether it's tmt.Test or tmt.base.Test.

Seems that ignore-module-all fixes that, see my comment above.

@psss psss self-assigned this Nov 16, 2023
happz and others added 2 commits November 16, 2023 12:21
Adding a new section into "Contribute" page, "Code documentation", and
besides the actual code documenation, I propose moving "Classes" page
there as well.
Get rid of one extra level in the left menu (to show more).
Provide a high-level overview of modules including steps.
Move the `Plugins` page under the new section as well.
@psss psss changed the title Add "autodocs", code documentation generated from docstrings Add code documentation generated from docstrings Nov 16, 2023
@psss psss merged commit 79da812 into main Nov 16, 2023
16 checks passed
@psss psss deleted the docs-add-autodocs branch November 16, 2023 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants