From 903ee1d2c068f63959dab2755d0679a1c0ce41f8 Mon Sep 17 00:00:00 2001 From: TheSchipper <107776081+TheSchipper@users.noreply.github.com> Date: Wed, 17 Apr 2024 21:22:35 -0400 Subject: [PATCH] Add starting doc pages --- .github/workflows/pages.yml | 56 +++++++++++++++++++++++++++++++++++++ docs/Makefile | 20 +++++++++++++ docs/make.bat | 35 +++++++++++++++++++++++ docs/source/conf.py | 35 +++++++++++++++++++++++ docs/source/index.rst | 20 +++++++++++++ docs/source/modules.rst | 8 ++++++ docs/source/src.rst | 17 +++++++++++ docs/source/tests.rst | 27 ++++++++++++++++++ 8 files changed, 218 insertions(+) create mode 100644 .github/workflows/pages.yml create mode 100644 docs/Makefile create mode 100644 docs/make.bat create mode 100644 docs/source/conf.py create mode 100644 docs/source/index.rst create mode 100644 docs/source/modules.rst create mode 100644 docs/source/src.rst create mode 100644 docs/source/tests.rst diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..9524f75 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,56 @@ +# Simple workflow for deploying static content to GitHub Pages +name: Deploy static content to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: ["main"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Single deploy job since we're just deploying + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Sphinx + run: | + pip install -U sphinx + + - name: Build docs + run: | + export PYTHONPATH=$PWD/src:$PYTHONPATH + sphinx-apidoc -o docs/source . + sphinx-build docs/source docs/build + + - name: Setup Pages + uses: actions/configure-pages@v5 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + # Upload entire repository + path: 'docs/build' + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d0c3cbf --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = source +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) diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..dc1312a --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=source +set BUILDDIR=build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 0000000..e613e8a --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,35 @@ +# 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 + +project = 'hcp-vault-secrets-client' +copyright = '2024, Sean Humes' +author = 'Sean Humes' +release = '0.0.1' + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + "sphinx.ext.duration", + "sphinx.ext.doctest", + "sphinx.ext.autodoc", + "sphinx.ext.viewcode", + "sphinx.ext.autosummary", + "sphinx.ext.githubpages", +] + +templates_path = ['_templates'] +exclude_patterns = [] + + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = 'haiku' +html_static_path = ['_static'] diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 0000000..c645c2d --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,20 @@ +.. hcp-vault-secrets-client documentation master file, created by + sphinx-quickstart on Wed Apr 17 19:16:31 2024. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to hcp-vault-secrets-client's documentation! +==================================================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + modules + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/source/modules.rst b/docs/source/modules.rst new file mode 100644 index 0000000..1399ef7 --- /dev/null +++ b/docs/source/modules.rst @@ -0,0 +1,8 @@ +hcp-vault-secrets-client +======================== + +.. toctree:: + :maxdepth: 4 + + src + tests diff --git a/docs/source/src.rst b/docs/source/src.rst new file mode 100644 index 0000000..6dd1512 --- /dev/null +++ b/docs/source/src.rst @@ -0,0 +1,17 @@ +src +=== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + src.hcp_vault_secrets_client + +Module contents +--------------- + +.. automodule:: src + :members: + :show-inheritance: diff --git a/docs/source/tests.rst b/docs/source/tests.rst new file mode 100644 index 0000000..9665f96 --- /dev/null +++ b/docs/source/tests.rst @@ -0,0 +1,27 @@ +tests +===== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + tests.unit + +Submodules +---------- + +tests.conftest module +--------------------- + +.. automodule:: tests.conftest + :members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: tests + :members: + :show-inheritance: