- Notifications
You must be signed in to change notification settings - Fork0
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
551e994c9576bae60cd831023e893df711068024cff32869ae8d61e46df9a02ef8733466b4901dd0cd6b370ad8162b63a9c47be47ba5dfa930245d67a1ad26f364f505fc6617File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| 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 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -23,6 +23,11 @@ clean-generated:## Cleanup generated code | ||
| generate:## Generate the code from the OpenAPI specs | ||
| ./bin/generate.sh | ||
| sphinx-docs:## Generate the documentation; uses the sphinx-generated Makefile in docs to clean and build html | ||
| ($(VENV_RUN); sphinx-apidoc --implicit-namespaces -o docs localstack-sdk-python/localstack) | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? | ||
| $(MAKE) -C docs clean | ||
| $(MAKE) -C docs html | ||
| format: | ||
| ($(VENV_RUN); python -m ruff format --exclude packages .; python -m ruff check --output-format=full --exclude packages --fix .) | ||
| 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) |
| 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", | ||
| } |
| 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 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| API Reference | ||
| ============= | ||
| .. toctree:: | ||
| :maxdepth: 4 | ||
| localstack.sdk |
Uh oh!
There was an error while loading.Please reload this page.