-
Notifications
You must be signed in to change notification settings - Fork 0
chore: use Sphinx for api doc generation #59
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
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c9ad3a9
delete old files
marikaner 04205cd
use sphinx
marikaner 0590309
docs: update pydoc3 documentation [skip ci]
sap-ai-sdk-bot[bot] 3b8d9d2
add helpers
marikaner b737648
add furo version
marikaner c663f2d
change dir structure of autogen docs
marikaner d7f8e76
chore: Add job to generate api docs (#62)
marikaner 77e5fd0
Merge branch 'main' into sphinx
marikaner 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| name: api-doc | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - 'gen-v*' | ||
| - 'base-v*' | ||
| - 'core-v*' | ||
| workflow_dispatch: ~ | ||
|
|
||
| jobs: | ||
| doc: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
|
|
||
| steps: | ||
| - name: Generate GitHub App token | ||
| id: app-token | ||
| uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 | ||
| with: | ||
| client-id: ${{ secrets.SAP_AI_SDK_BOT_CLIENT_ID }} | ||
| private-key: ${{ secrets.SAP_AI_SDK_BOT_PRIVATE_KEY }} | ||
| repositories: | | ||
| ai-sdk-python | ||
| ai-sdk | ||
| permission-contents: write | ||
| permission-pull-requests: write | ||
|
|
||
| - name: Setup | ||
| uses: SAP/ai-sdk-python/.github/actions/setup@main | ||
| with: | ||
| token: ${{ steps.app-token.outputs.token }} | ||
| ref: ${{ github.ref }} | ||
| - name: Generate docs | ||
| run: uv run make docs | ||
|
|
||
| - name: Checkout sap/ai-sdk | ||
| uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 | ||
| with: | ||
| repository: SAP/ai-sdk | ||
| token: ${{ steps.app-token.outputs.token }} | ||
| path: ai-sdk | ||
| persist-credentials: false | ||
|
|
||
| - name: Configure git | ||
| env: | ||
| BOT_EMAIL: ${{ vars.SAP_AI_SDK_BOT_EMAIL }} | ||
| BOT_NAME: ${{ vars.SAP_AI_SDK_BOT_NAME }} | ||
| run: | | ||
| git -C ai-sdk config user.email "$BOT_EMAIL" | ||
| git -C ai-sdk config user.name "$BOT_NAME" | ||
|
|
||
| - name: Update api docs | ||
| id: update-docs | ||
| env: | ||
| REF: ${{ github.ref_name }} | ||
| run: | | ||
| BRANCH="api-docs-python-$REF" | ||
| echo "branch=$BRANCH" >> "$GITHUB_OUTPUT" | ||
| cd ai-sdk | ||
| git checkout -b "$BRANCH" | ||
| rm -rf static/api-python | ||
| cp -r ../api-docs/ static/api-python | ||
| git add static/api-python | ||
| if git diff --cached --quiet; then | ||
| echo "No documentation changes to commit" | ||
| echo "changed=false" >> "$GITHUB_OUTPUT" | ||
| else | ||
| git commit -m "chore: update Python API docs ($REF)" | ||
| git push --force origin "$BRANCH" | ||
| echo "changed=true" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| - name: Create pull request | ||
| if: steps.update-docs.outputs.changed == 'true' | ||
| env: | ||
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | ||
| REF: ${{ github.ref_name }} | ||
| BRANCH: ${{ steps.update-docs.outputs.branch }} | ||
| run: | | ||
| if [ "$GITHUB_EVENT_NAME" = "workflow_dispatch" ]; then | ||
| REF_URL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/tree/$REF" | ||
| else | ||
| REF_URL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/tag/$REF" | ||
| fi | ||
| if gh pr list --repo SAP/ai-sdk --head "$BRANCH" --json number --jq '.[0].number' | grep -q .; then | ||
| echo "Pull request already exists for branch $BRANCH" | ||
| else | ||
| gh pr create \ | ||
| --repo SAP/ai-sdk \ | ||
| --base main \ | ||
| --head "$BRANCH" \ | ||
| --title "chore: update Python API docs ($REF)" \ | ||
| --body "Automated update of Python API docs from [$REF]($REF_URL) in SAP/ai-sdk-python." | ||
| fi |
This file was deleted.
Oops, something went wrong.
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 |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| project = "SAP AI SDK Python" | ||
| extensions = [ | ||
| "sphinx.ext.autodoc", | ||
| "sphinx.ext.napoleon", | ||
| ] | ||
| html_theme = "furo" | ||
| exclude_patterns = ["_autogen/*/modules.rst"] | ||
| autodoc_default_options = { | ||
| "members": True, | ||
| "undoc-members": True, | ||
| "private-members": False, | ||
| "show-inheritance": True, | ||
| "special-members": "__init__", | ||
| } | ||
| autodoc_member_order = "bysource" |
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,17 @@ | ||
| SAP AI SDK Python | ||
| ================= | ||
|
|
||
| .. toctree:: | ||
| :maxdepth: 1 | ||
| :caption: Packages | ||
|
|
||
| _autogen/base/ai_api_client_sdk | ||
| _autogen/core/ai_core_sdk | ||
| _autogen/gen/gen_ai_hub | ||
|
|
||
| Indices | ||
| ------- | ||
|
|
||
| * :ref:`genindex` | ||
| * :ref:`modindex` | ||
| * :ref:`search` |
131 changes: 0 additions & 131 deletions
131
packages/base/docs/ai_api_client_sdk.ai_api_v2_client.html
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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.