-
Notifications
You must be signed in to change notification settings - Fork 0
Adding docstrings and introducing sphinx draft #12
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
20 commits
Select commit
Hold shift + click to select a range
551e994
docs for the chaos client
giograno c9576ba
docs for the pods SDK
giograno e60cd83
more docstrings
giograno 1023e89
add sphinx to the dev dependencies (will try to play with doc generat…
giograno 3df7110
docs
giograno 68024cf
makefile to generate docs
giograno f32869a
improve rst files
giograno e8d61e4
improve rst files
giograno 6df9a02
action to generate docs in a github-pages branch
giograno ef87334
fix indentation in docstrings
giograno 66b4901
moving clients module in sdk
giograno dd0cd6b
minor changes to improve docs generation
giograno 370ad81
docs file to have in the repo
giograno 62b63a9
fix host
giograno c47be47
run sphinxs workflow on main
giograno ba5dfa9
proper version
giograno 30245d6
add version constraints
giograno 7a1ad26
remove make.bat
giograno f364f50
add comment for the sphix makefile
giograno 5fc6617
more makefile comment
giograno 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,41 @@ | ||
name: Build sphinx documentation | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'docs/**' | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v3 | ||
|
||
- name: Install project | ||
run: | | ||
make install-dev | ||
|
||
- name: Generate docs | ||
run: | ||
make sphinx-docs | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: html-docs | ||
path: docs/_build/html/ | ||
|
||
- name: Deploy | ||
uses: peaceiris/actions-gh-pages@v3 | ||
if: github.ref == 'refs/heads/main' | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: docs/_build/html |
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,21 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# Mostly use by the project Makefile to access the clean and html targets | ||
# | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = . | ||
BUILDDIR = _build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,59 @@ | ||
# Configuration file for the Sphinx documentation builder. | ||
# | ||
# For the full list of built-in configuration values, see the documentation: | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html | ||
|
||
# -- Project information ----------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information | ||
|
||
import os | ||
import sys | ||
|
||
sys.path.insert(0, os.path.abspath("../localstack-sdk-python/localstack")) | ||
|
||
|
||
def _get_version() -> str: | ||
with open(os.path.abspath("../VERSION"), "r") as f: | ||
version = f.read() | ||
return version | ||
|
||
|
||
project = "LocalStack Python SDK" | ||
copyright = "2024, LocalStack Team" | ||
author = "LocalStack Team" | ||
release = _get_version() | ||
|
||
# -- General configuration --------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration | ||
|
||
# enable auto-doc extension | ||
extensions = ["sphinx.ext.autodoc"] | ||
|
||
templates_path = ["_templates"] | ||
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] | ||
|
||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output | ||
|
||
html_theme = "alabaster" | ||
html_static_path = ["_static"] | ||
|
||
html_sidebars = { | ||
"**": [ | ||
"about.html", | ||
"searchfield.html", | ||
"navigation.html", | ||
] | ||
} | ||
|
||
html_theme_options = { | ||
"extra_nav_links": { | ||
"Source": "https://github.com/localstack/localstack-sdk-python", | ||
"Issues": "https://github.com/localstack/localstack-sdk-python/issues", | ||
"PyPI": "https://pypi.org/project/localstack-sdk-python/", | ||
}, | ||
"description": "Python SDK to interact with LocalStack developer endpoints", | ||
"github_user": "localstack", | ||
"github_repo": "localstack-sdk-python", | ||
} |
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,52 @@ | ||
.. image:: _static/localstack-horizontal.png | ||
:align: center | ||
:target: https://localstack.cloud | ||
|
||
This is the documentation for the Python | ||
`LocalStack's SDK <https://github.com/localstack/localstack-sdk-python>`_. | ||
|
||
LocalStack offers a number of developer endpoints to programmatically interact | ||
with LocalStack's features. | ||
|
||
The complete OpenAPI spec can be found in the | ||
`OpenAPI repository <https://github.com/localstack/openapi>`_. | ||
|
||
Installation | ||
------------ | ||
|
||
We recommend to user virtual environments to manage the dependencies of your project. | ||
|
||
To create and activate a virtual environment inside your project run: | ||
|
||
.. code-block:: shell | ||
|
||
python3 -m venv venv | ||
|
||
You can activate the correspondent provider with: | ||
|
||
.. code-block:: shell | ||
|
||
. venv/bin/activate | ||
|
||
With the activated environment, use the following command to install the LocalStack Python SDK. | ||
|
||
.. code-block:: shell | ||
|
||
pip install localstack-sdk-python | ||
|
||
Getting Started | ||
--------------- | ||
|
||
To learn about the basic SDK concepts and see how you can use it, please have a look at our | ||
official `LocalStack documentation <https://docs.localstack.cloud/user-guide/tools/localstack-sdk/python/>`_. | ||
|
||
API Reference | ||
------------- | ||
|
||
If you are looking for information on a specific function, class or | ||
method, this part of the documentation is for you. | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
modules |
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,7 @@ | ||
API Reference | ||
============= | ||
|
||
.. toctree:: | ||
:maxdepth: 4 | ||
|
||
localstack.sdk |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: Should this maybe also just use the sphinx "catch all make target" in line 20 of the Makefile in the docs folder?