Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/actions/get_pr_number/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ runs:
exit 1
fi
echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV
echo "BUILD_PREVIEW=1" >> $GITHUB_ENV

- name: Get PR data (main branch)
if: ${{ github.ref_name == 'main' }}
Expand Down Expand Up @@ -50,3 +51,4 @@ runs:
exit 1
fi
echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV
echo "BUILD_LATEST=1" >> $GITHUB_ENV
11 changes: 8 additions & 3 deletions cuda_bindings/docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,14 @@
# ],
}
if os.environ.get("CI"):
PR_NUMBER = f"{os.environ['PR_NUMBER']}"
PR_TEXT = f'<a href="https://github.com/NVIDIA/cuda-python/pull/{PR_NUMBER}">PR {PR_NUMBER}</a>'
html_theme_options["announcement"] = f"<em>Warning</em>: This documentation is only a preview for {PR_TEXT}!"
if int(os.environ.get("BUILD_PREVIEW", 0)):
PR_NUMBER = f"{os.environ['PR_NUMBER']}"
PR_TEXT = f'<a href="https://github.com/NVIDIA/cuda-python/pull/{PR_NUMBER}">PR {PR_NUMBER}</a>'
html_theme_options["announcement"] = f"<em>Warning</em>: This documentation is only a preview for {PR_TEXT}!"
elif int(os.environ.get("BUILD_LATEST", 0)):
html_theme_options["announcement"] = (
"<em>Warning</em>: This documentation is built from the development branch!"
)

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand Down
11 changes: 8 additions & 3 deletions cuda_core/docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,14 @@
# ],
}
if os.environ.get("CI"):
PR_NUMBER = f"{os.environ['PR_NUMBER']}"
PR_TEXT = f'<a href="https://github.com/NVIDIA/cuda-python/pull/{PR_NUMBER}">PR {PR_NUMBER}</a>'
html_theme_options["announcement"] = f"<em>Warning</em>: This documentation is only a preview for {PR_TEXT}!"
if int(os.environ.get("BUILD_PREVIEW", 0)):
PR_NUMBER = f"{os.environ['PR_NUMBER']}"
PR_TEXT = f'<a href="https://github.com/NVIDIA/cuda-python/pull/{PR_NUMBER}">PR {PR_NUMBER}</a>'
html_theme_options["announcement"] = f"<em>Warning</em>: This documentation is only a preview for {PR_TEXT}!"
elif int(os.environ.get("BUILD_LATEST", 0)):
html_theme_options["announcement"] = (
"<em>Warning</em>: This documentation is built from the development branch!"
)

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand Down
17 changes: 9 additions & 8 deletions cuda_python/docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,14 @@
# ],
}
if os.environ.get("CI"):
PR_NUMBER = f"{os.environ['PR_NUMBER']}"
PR_TEXT = f'<a href="https://github.com/NVIDIA/cuda-python/pull/{PR_NUMBER}">PR {PR_NUMBER}</a>'
html_theme_options["announcement"] = (
f"<em>Warning</em>: This documentation is only a preview for {PR_TEXT}!"
)
if int(os.environ.get("BUILD_PREVIEW", 0)):
PR_NUMBER = f"{os.environ['PR_NUMBER']}"
PR_TEXT = f'<a href="https://github.com/NVIDIA/cuda-python/pull/{PR_NUMBER}">PR {PR_NUMBER}</a>'
html_theme_options["announcement"] = f"<em>Warning</em>: This documentation is only a preview for {PR_TEXT}!"
elif int(os.environ.get("BUILD_LATEST", 0)):
html_theme_options["announcement"] = (
"<em>Warning</em>: This documentation is built from the development branch!"
)

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand All @@ -86,9 +89,7 @@
# Allow overwriting CUDA Python's domain name for local development. See:
# - https://stackoverflow.com/a/61694897/2344149
# - https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-rst_epilog
CUDA_PYTHON_DOMAIN = os.environ.get(
"CUDA_PYTHON_DOMAIN", "https://nvidia.github.io/cuda-python"
)
CUDA_PYTHON_DOMAIN = os.environ.get("CUDA_PYTHON_DOMAIN", "https://nvidia.github.io/cuda-python")
rst_epilog = f"""
.. _cuda.core: {CUDA_PYTHON_DOMAIN}/cuda-core/latest
.. _cuda.bindings: {CUDA_PYTHON_DOMAIN}/cuda-bindings/latest
Expand Down
3 changes: 3 additions & 0 deletions cuda_python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ homepage = "https://nvidia.github.io/cuda-python/"
documentation = "https://nvidia.github.io/cuda-python/"
repository = "https://github.com/NVIDIA/cuda-python/"
issues = "https://github.com/NVIDIA/cuda-python/issues/"

[tool.ruff]
line-length = 120
Loading