-
Notifications
You must be signed in to change notification settings - Fork 41
Generate api docs for EESSI test suite #319
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
Merged
Merged
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
30b717a
generate api docs
xinan1911 3fdb896
Update deploy.yml and schedule
xinan1911 80f2c3a
Update deploy.yml syntax
xinan1911 5c7ef65
Update test.yml
xinan1911 65131b8
Update deploy.yml for action version
xinan1911 1994da4
Update test.yml
xinan1911 33762ff
Update deploy.yml resolve failed build
xinan1911 0004eb3
Update test.yml resolve failed build
xinan1911 12dc637
Update test.yml actions/setup-python@v5
xinan1911 9ca30ae
Moved location of testsuite API docs, as well as subdir
170da31
Resolved conflicts with upstream
9a027b2
Don't clone into src subdir, the subdir will already be test-suite, t…
422a20e
Put back EESSI in CI section, it was unintendely removed in this feat…
dd28578
Also remove the subdir for the checkout of EESSI test-suite in the te…
b870f15
Expand update_generated_time functionality so that we may reuse it in…
0d242ef
Make this a manual action
a99c6db
Restore original deploy.yml
322d0d4
.github/workflows/test.yml
1e31fd7
Simplify gen_ref_pages by removing commented code and documenting the…
e1ab323
Cleaned up code for automatically generating docs with mkdocs for EES…
51c3d48
Now really do it only on manual trigger
15ff385
Fix codespell issue
2aae108
Specify dedicated checkout path for cloning the testsuite repo
6726d44
Checking in test-suite path, otherwise the checkout overwrite any pre…
7d3189f
Makre sure te summary MD is also written to testsuite_api
af73133
Fix cross reference
09a7a5f
Change deployment strategy, as the autogenerated API docs end up dire…
3364006
add error for when test-suite repo is not available
laraPPr 25e5c37
resolve merge conflicts
laraPPr 4d9deda
updated the versions of the actions in the pr
laraPPr 3c5ee20
update github actions
laraPPr 29dbb15
fix workflow. hopefully?
laraPPr b92db86
fix workflow. With a little help
laraPPr 8a3aa5d
fix now test.yml as well
laraPPr fb59aab
another fix of the CI
laraPPr 25c86d5
fix typo in workflow
laraPPr f213810
make sure that the test-suite is available in the right location
laraPPr 6c593b3
don't use fetch-true
laraPPr d831e05
check if the CI is now building the docs with the main branch of the …
laraPPr 2597103
make sure that the latest release of test-suite is used and not the m…
laraPPr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ site/ | |
venv* | ||
scripts/available_software/__pycache__ | ||
scripts/available_software/tests/__pycache__ | ||
|
||
test-suite |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
""" | ||
Generate the code reference pages. | ||
Based off https://mkdocstrings.github.io/recipes/#automatic-code-reference-pages | ||
""" | ||
|
||
import os | ||
|
||
from pathlib import Path | ||
|
||
import mkdocs_gen_files | ||
|
||
TEST_SUITE = "test-suite/test-suite" | ||
|
||
if not os.path.isdir(TEST_SUITE): | ||
raise FileNotFoundError(f"Error: {TEST_SUITE} does not exist. Please clone the eessi/test-suite in a test-suite dir.") | ||
|
||
# build a navigation for the menu and a dictionary of navigations for each section | ||
nav = mkdocs_gen_files.Nav() | ||
|
||
# Loop through all python files in test-suite/eessi | ||
for path in sorted(Path(f"{TEST_SUITE}/eessi/").rglob("*.py")): | ||
casparvl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# Get the relative filename, without .py suffix | ||
module_path = path.relative_to(TEST_SUITE).with_suffix("") | ||
|
||
# define the corresponding (relative) markdown filename | ||
doc_path = path.relative_to(TEST_SUITE).with_suffix(".md") | ||
|
||
# Specify the full corresponding markdown filename, including a testsuite_api subdir | ||
# so that we don't have these API docs scattered in the root of the EESSI docs repo | ||
full_doc_path = Path("testsuite_api/", doc_path) | ||
|
||
# If something is an __init__, use the directory name as the name of the python module instead of the filename | ||
parts = list(module_path.parts) | ||
if parts[-1] == "__init__": | ||
casparvl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
parts = parts[:-1] | ||
# Skip the __main__, if there is one. This is not part of the API | ||
elif parts[-1] == "__main__": | ||
continue | ||
|
||
# Add an entry for this module to the navigation | ||
nav[parts] = doc_path.as_posix() | ||
|
||
# Create the markdown file | ||
with mkdocs_gen_files.open(full_doc_path, "w") as fd: | ||
# identifier is something like eessi.foo.bar | ||
identifier = ".".join(parts) | ||
fd.write(f"::: {identifier}") | ||
|
||
# This maps the generated .md file to the source .py, so that you can have an "Edit on GitHub" button | ||
# that links to the Python code | ||
mkdocs_gen_files.set_edit_path(full_doc_path, path) | ||
|
||
# Create the api/summary.md file and write the full navigation tree into it so it can be used as a site sidebar | ||
with mkdocs_gen_files.open("testsuite_api/summary.md", "w") as nav_file: | ||
nav_file.writelines(nav.build_literate_nav()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.