Skip to content

Commit

Permalink
Add Nitrokey Python SDK documentation
Browse files Browse the repository at this point in the history
Fixes: #329
  • Loading branch information
robin-nitrokey committed Nov 26, 2024
1 parent 99ebc53 commit 0814b98
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Install additional python packages
run: pip3 install -r requirements.txt

- name: Install Nitrokey Python SDK
run: pip3 install ./nitrokey-sdk-py

- name: Quick build docs
run: |
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@ jobs:
syntax-check:
name: Check syntax
runs-on: ubuntu-latest
container: python:3.11-slim
container: python:3.11
continue-on-error: true
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true
- name: Create virtual environment
run: |
python -m venv venv
venv/bin/pip3 install -r requirements.txt
venv/bin/pip3 install ./nitrokey-sdk-py
- name: Syntax check
run: |
. venv/bin/activate
Expand All @@ -23,14 +26,17 @@ jobs:
build-error-check:
name: Check build error
runs-on: ubuntu-latest
container: python:3.11-slim
container: python:3.11
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true
- name: Create virtual environment
run: |
python -m venv venv
venv/bin/pip3 install -r requirements.txt
venv/bin/pip3 install ./nitrokey-sdk-py
- name: Build documentation
run: |
. venv/bin/activate
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "nitrokey-sdk-py"]
path = nitrokey-sdk-py
url = https://github.com/Nitrokey/nitrokey-sdk-py.git
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ all: venv
venv:
python -m venv venv
venv/bin/pip3 install -r requirements.txt
venv/bin/pip3 install ./nitrokey-sdk-py

clean:
rm -rf dist build venv
1 change: 1 addition & 0 deletions nitrokey-sdk-py
Submodule nitrokey-sdk-py added at 4fa730
1 change: 1 addition & 0 deletions source/components/software/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ Software

nk-app2/index
nitropy/index
nitrokey-sdk-py/index
1 change: 1 addition & 0 deletions source/components/software/nitrokey-sdk-py
9 changes: 8 additions & 1 deletion source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.todo',
'sphinx.ext.coverage',
#'sphinx_copybutton',
Expand Down Expand Up @@ -71,7 +72,7 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['venv/*', 'components/nethsm/_*.rst', 'components/to-be-integrated.rst']
exclude_patterns = ['venv/*', 'components/nethsm/_*.rst', 'components/to-be-integrated.rst', 'nitrokey-sdk-py/*']

# The name of the Pygments (syntax highlighting) style to use.
#pygments_style = "solarizeddark"
Expand Down Expand Up @@ -434,3 +435,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'

0 comments on commit 0814b98

Please sign in to comment.