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 API docs #1634

Merged
merged 39 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
205f574
generate api docs
kcpevey Oct 24, 2022
38a80de
add api docs here, add workflow
kcpevey Oct 25, 2022
4f908c8
add temp file
kcpevey Oct 25, 2022
615c41a
linting
kcpevey Oct 25, 2022
98a2576
Merge branch 'release/2022.11.1' into api_docs
aktech Nov 30, 2022
7390150
updates for nebari rename and other minor fixes
kcpevey Dec 14, 2022
aed5ead
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 14, 2022
e59510f
merge conflicts
kcpevey Dec 14, 2022
29ef6e9
remove conda from ci, update readme, finish rename
kcpevey Dec 14, 2022
a64666f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 14, 2022
dc97400
formatting
kcpevey Dec 14, 2022
165d730
allow precommit to error in order to lint
kcpevey Dec 14, 2022
7a4561e
remove setup.cfg to resolve conflict
kcpevey Dec 15, 2022
8b8f817
try continue-on-error
kcpevey Dec 15, 2022
09c153e
move docs requirements into pyproject.toml
kcpevey Dec 15, 2022
c1e338b
security hooha
kcpevey Dec 15, 2022
5e4dca6
modify the watch for changes
kcpevey Dec 15, 2022
23006ad
Update pyproject.toml
kcpevey Jan 23, 2023
59df104
Merge branch 'nebari-dev:develop' into api_docs
kcpevey Jan 31, 2023
2db398b
specify base branch
kcpevey Jan 31, 2023
3418079
cleanup
kcpevey Mar 10, 2023
38e1dd2
Merge branch 'develop' into api_docs
kcpevey Mar 10, 2023
81aebf5
switching to sphinx-click
kcpevey Mar 20, 2023
1d950b8
rename file
kcpevey Mar 20, 2023
9cdaf9e
add sphinx-click docs
kcpevey Mar 20, 2023
5da3cc7
remove old files
kcpevey Mar 20, 2023
ecf27b6
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Mar 20, 2023
bf4e64f
fix precommit hooks
kcpevey Mar 20, 2023
9271c6b
Merge branch 'develop' into api_docs
kcpevey Mar 20, 2023
4e3a7f7
Merge branch 'develop' into api_docs
iameskild Apr 24, 2023
3f1d20b
Merge branch 'develop' into api_docs
iameskild May 1, 2023
bf995fc
Merge branch 'develop' into api_docs
iameskild May 18, 2023
2fef789
merge conflict resolution
kcpevey Aug 3, 2023
385523d
update cli docs
kcpevey Aug 4, 2023
9d8ed8a
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Aug 4, 2023
4be2346
merge conflicts
kcpevey Aug 22, 2023
f63fa0f
updated for changes to cli
kcpevey Aug 22, 2023
b8b269f
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Aug 22, 2023
7b1f3d4
Merge branch 'develop' into api_docs
kcpevey Sep 11, 2023
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
82 changes: 82 additions & 0 deletions .github/workflows/update_api_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Update API docs

on:
pull_request:
push:
branches:
kcpevey marked this conversation as resolved.
Show resolved Hide resolved
- main
workflow_dispatch:

jobs:
update_api:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
working-directory: ./docs/api_docs
steps:
- name: Check out repository 🛎️
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: "3.10"

- name: Install nebari and docs dependencies
run: |
python -m pip install --upgrade pip
pip install -e "../..[docs]"

- name: Generate new API docs
run: |
echo "generate the new docs"
pydoc-markdown -I "../../" -p nebari --render-toc > api_temp.md
echo "make modifications to clean up"
python api_doc_mods.py --autogen_path api_temp.md --outpath api_doc.md

- name: Lint the new docs
continue-on-error: true
run: |
echo "run linting and formatting"
pre-commit run --files api_doc.md
echo "run it again to prove its clean now"
pre-commit run --files api_doc.md

- name: Check for changes
run: |
if git diff --exit-code; then
echo "changes_exist=true" >> $GITHUB_ENV
else
echo "changes_exist=false" >> $GITHUB_ENV
fi

- name: Look for changes to cli files
uses: tj-actions/verify-changed-files@v12
id: verify-changed-files
with:
files: |
docs/api_docs/api_doc.md

- name: Create Pull Request in code repo
id: create_pull_request
uses: peter-evans/create-pull-request@v4
if: steps.verify-changed-files.outputs.files_changed == 'true'
with:
token: ${{ secrets.NEBARI_SENSEI_API_DOCS_PR_OPENER }}
commit-message: Update report
committer: GitHub <noreply@github.com>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
signoff: false
branch: auto_api_doc_update
delete-branch: true
title: '[AUTO] Update API doc'
body: |
Update API doc
- Auto-generated by [create-pull-request][1]

[1]: https://github.com/peter-evans/create-pull-request
labels: |
"area: documentation 📖"
draft: false
base: ${{ github.head_ref }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# docs
.nox
_build
docs/api_docs/api_temp.md

# setuptools scm
nebari/_version.py
Expand Down
3 changes: 3 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,6 @@ yarn-error.log*

app/__pycache__
docs/users.pdf

# docs
docs/api_docs/api_temp.md
28 changes: 28 additions & 0 deletions docs/api_docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Nebari API docs

The Nebari API docs are generated from this repo, then merged into the nebari-docs repo via PR opened by GitHub Actions.

## Environment

From the root of the repo:

```bash
pip install -e ".[docs]"
```

## Workflow

The docs may be built manually through the following workflow, or executed as part of an autoupdate via GH Actions CI.

The workflow described below will create the API docs and run a formatting script to do a bit of cleanup.

```bash
# work out of the api_docs directory in the nebari repo
cd docs/api_docs/
# auto generate the api docs
pydoc-markdown -I "../../" -p nebari --render-toc > api_temp.md
# make formatting modifications and copy into the docs repo
python api_doc_mods.py --autogen_path api_temp.md --outpath api_doc.md
# run linting and formatting
pre-commit run --files api_doc.md
```
Loading