-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding docstrings and introducing sphinx draft (#12)
- Loading branch information
Showing
16 changed files
with
680 additions
and
35 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
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 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,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 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 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 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 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.