diff --git a/.gitignore b/.gitignore index eff47bedf..1b4a8f6be 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ build dist venv +nitrokey-sdk-py* diff --git a/Makefile b/Makefile index e46b7eee9..2647f9bee 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,20 @@ +NITROKEY_SDK_PY_VERSION ?= v0.2.3 +NITROKEY_SDK_PY_CHECKSUM ?= b0547efe0bce6907f831a80297baf5393825037d3996edd6cf9f1ccc796e736e +NITROKEY_SDK_PY_URL := https://github.com/Nitrokey/nitrokey-sdk-py/archive/refs/tags/$(NITROKEY_SDK_PY_VERSION).tar.gz +NITROKEY_SDK_PY := nitrokey-sdk-py-$(NITROKEY_SDK_PY_VERSION) +NITROKEY_SDK_PY_ARCHIVE := $(NITROKEY_SDK_PY).tar.gz +NITROKEY_SDK_PY_LINK := source/components/software/nitrokey-sdk-py .PHONY: docs docs: venv venv/bin/sphinx-build -j auto -b html -D language=en -d build/en/doctrees source dist/en -venv: +.PHONY: venv +venv: $(NITROKEY_SDK_PY) python -m venv venv venv/bin/pip3 install -r requirements.txt + venv/bin/pip3 install ./$(NITROKEY_SDK_PY) .PHONY: check check: venv @@ -23,9 +31,19 @@ pkg: venv docs clean: - rm -rf dist build + rm -rf dist build nitrokey-sdk-py* $(NITROKEY_SDK_PY_LINK) cleaner: clean rm -rf venv .PHONY: docs check pkg + +$(NITROKEY_SDK_PY): $(NITROKEY_SDK_PY_ARCHIVE) + mkdir "$@" + tar --directory "$@" --extract --strip-components 1 --file "$<" + rm -f $(NITROKEY_SDK_PY_LINK) + ln -s ../../../$(NITROKEY_SDK_PY)/docs $(NITROKEY_SDK_PY_LINK) + +$(NITROKEY_SDK_PY_ARCHIVE): + curl "$(NITROKEY_SDK_PY_URL)" --location --output "$@" + echo "$(NITROKEY_SDK_PY_CHECKSUM) $@" | sha256sum -c diff --git a/source/components/software/index.rst b/source/components/software/index.rst index 2fc32150d..86736050c 100644 --- a/source/components/software/index.rst +++ b/source/components/software/index.rst @@ -7,3 +7,4 @@ Software nk-app2/index nitropy/index + nitrokey-sdk-py/index diff --git a/source/conf.py b/source/conf.py index 0b70485b8..24405b4c7 100644 --- a/source/conf.py +++ b/source/conf.py @@ -40,6 +40,7 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ + "sphinx.ext.autodoc", "sphinx.ext.todo", "sphinx.ext.coverage", #'sphinx_copybutton', @@ -413,3 +414,9 @@ # Disables the closing of tabs if clicked on the currently active tab sphinx_tabs_disable_tab_closing = True + +# -- Options for autodoc extension ------------------------------------------- + +autodoc_class_signature = 'separated' +autodoc_member_order = 'groupwise' +autodoc_typehints = 'description'