-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
275 changed files
with
16,273 additions
and
40,042 deletions.
There are no files selected for viewing
This file contains 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 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,30 @@ | ||
name: Deploy Sphinx documentation to Pages | ||
|
||
# Runs on pushes targeting the default branch | ||
on: | ||
push: | ||
branches: [github-pages] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Build HTML | ||
uses: ammaraskar/sphinx-action@master | ||
with: | ||
docs-folder: "docs/" | ||
build-command: "python ../build_docs.py" | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: html-docs | ||
path: docs/_build/html/ | ||
- name: Deploy | ||
uses: peaceiris/actions-gh-pages@v3 | ||
if: github.ref == 'refs/heads/github-pages' | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: docs/_build/html |
This file contains 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 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,24 @@ | ||
stages: | ||
- deploy | ||
|
||
pages: | ||
stage: deploy | ||
image: python:3.11-slim | ||
before_script: | ||
- echo -e "\\e[0Ksection_start:`date +%s`:my_first_section[collapsed=true]\\r\\e[0KSet up docs environment" | ||
- apt-get update && apt-get install make --no-install-recommends -y | ||
- python -m pip install --upgrade pip | ||
- python -m pip install -r docs/requirements.txt | ||
- echo -e "\\e[0Ksection_end:`date +%s`:my_first_section\\r\\e[0K" | ||
script: | ||
- cd docs && make clean | ||
- python ../build_docs.py --no-color | ||
after_script: | ||
- mv docs/_build/html/ ./public/ | ||
artifacts: | ||
paths: | ||
- public | ||
rules: | ||
- if: $CI_COMMIT_BRANCH == "master" | ||
tags: | ||
- pages |
This file contains 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 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 |
---|---|---|
@@ -1,38 +1,47 @@ | ||
# Copyright (c) 2022 NVIDIA CORPORATION. All rights reserved. | ||
# NVIDIA CORPORATION and its licensors retain all intellectual property | ||
# and proprietary rights in and to this software, related documentation | ||
# and any modifications thereto. Any use, reproduction, disclosure or | ||
# distribution of this software and related documentation without an express | ||
# license agreement from NVIDIA CORPORATION is strictly prohibited. | ||
|
||
import os | ||
import sys | ||
import subprocess | ||
import sys | ||
|
||
import warp as wp | ||
|
||
|
||
wp.init() | ||
from warp.context import export_functions_rst, export_stubs | ||
|
||
# docs | ||
|
||
# disable sphinx color output | ||
os.environ["NO_COLOR"] = "1" | ||
|
||
with open("docs/modules/functions.rst", "w") as function_ref: | ||
wp.print_builtins(function_ref) | ||
base_path = os.path.dirname(os.path.realpath(__file__)) | ||
|
||
with open(os.path.join(base_path, "docs", "modules", "functions.rst"), "w") as function_ref: | ||
export_functions_rst(function_ref) | ||
|
||
# run Sphinx build | ||
try: | ||
if os.name == 'nt': | ||
subprocess.check_output("make.bat html", cwd="docs", shell=True) | ||
docs_folder = os.path.join(base_path, "docs") | ||
make_html_cmd = ["make.bat" if os.name == "nt" else "make", "html"] | ||
|
||
if os.name == "nt" or len(sys.argv) == 1: | ||
subprocess.check_output(make_html_cmd, cwd=docs_folder) | ||
else: | ||
subprocess.run("make clean", cwd="docs", shell=True) | ||
subprocess.check_output("make html", cwd="docs", shell=True) | ||
# Sphinx options were passed via the argument list | ||
make_html_cmd.append("-e") | ||
sphinx_options = " ".join(sys.argv[1:]) | ||
subprocess.check_output(make_html_cmd, cwd=docs_folder, env=dict(os.environ, SPHINXOPTS=sphinx_options)) | ||
except subprocess.CalledProcessError as e: | ||
print(e.output.decode()) | ||
raise e | ||
|
||
|
||
# generate stubs for autocomplete | ||
stub_file = open("warp/stubs.py", "w") | ||
wp.export_stubs(stub_file) | ||
stub_file.close() | ||
with open(os.path.join(base_path, "warp", "stubs.py"), "w") as stub_file: | ||
export_stubs(stub_file) | ||
|
||
# code formatting | ||
subprocess.run([sys.executable, "-m", "black", "warp/stubs.py"]) | ||
subprocess.run([sys.executable, "-m", "black", os.path.join(base_path, "warp", "stubs.py")]) | ||
|
||
print("Finished") |
This file contains 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
Oops, something went wrong.