Skip to content

Commit

Permalink
fixup for keeping files based on github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
bpkroth committed Nov 13, 2024
1 parent b3c2536 commit 8088719
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ endif

# Treat warnings as failures.
SPHINXOPTS ?= # -v # be verbose
SPHINXOPTS += -n -W -w $(PWD)/doc/build/sphinx-build.warn.log -j auto
SPHINXOPTS += -n -W -w $(CURDIR)/doc/build/sphinx-build.warn.log -j auto

sphinx-apidoc: doc/build/html/index.html

Expand Down
9 changes: 8 additions & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,13 @@ def linkcode_resolve(domain: str, info: Dict[str, str]):
return f"https://github.com/microsoft/MLOS/tree/main/{path}"


def is_on_github_actions():
"""Check if the documentation is being built on GitHub Actions."""
if "CI" not in os.environ or not os.environ["CI"] or "GITHUB_RUN_ID" not in os.environ:
return False
return True


# Add mappings to link to external documentation.
intersphinx_mapping = get_intersphinx_mapping(
packages={
Expand Down Expand Up @@ -242,7 +249,7 @@ def linkcode_resolve(domain: str, info: Dict[str, str]):
autoapi_python_class_content = "both"
autoapi_member_order = "groupwise"
autoapi_add_toctree_entry = False # handled manually
# autoapi_keep_files = True # for testing
autoapi_keep_files = not is_on_github_actions() # for local testing

# -- Options for HTML output -------------------------------------------------

Expand Down

0 comments on commit 8088719

Please sign in to comment.