From 4d99601fc64db8f73761ef43a3f21977ee82dae0 Mon Sep 17 00:00:00 2001 From: Philipp Horstenkamp Date: Thu, 28 Sep 2023 19:05:05 +0200 Subject: [PATCH] Optional docs Feature: Changelog (#155) Added the ability to generate a changelog of the main branch in the Documenation. --- .github/workflows/documentation.yaml | 6 ++- documentations/conf.py | 1 + documentations/index.rst | 10 +++++ poetry.lock | 59 +++++++++++++++++++++++++++- pyproject.toml | 1 + 5 files changed, 74 insertions(+), 3 deletions(-) diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index abd7c5b..b7639dc 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -16,7 +16,9 @@ jobs: run: | sudo apt install pandoc snapd -y sudo snap install drawio - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Setup Python uses: actions/setup-python@v4 with: @@ -26,7 +28,7 @@ jobs: with: version: 1.4.2 virtualenvs-create: false - - run: poetry install --only doc,root,develop --all-extras + - run: poetry install --with doc --all-extras --without test,lint - name: Doc-Build run: | cd documentations diff --git a/documentations/conf.py b/documentations/conf.py index e1cece0..12d40de 100644 --- a/documentations/conf.py +++ b/documentations/conf.py @@ -45,6 +45,7 @@ extensions: Final[list[str]] = [ "sphinxcontrib.mermaid", "notfound.extension", "sphinxcontrib.drawio", + "sphinx_git", ] # templates_path : Final[list[str]] = ["_templates"] diff --git a/documentations/index.rst b/documentations/index.rst index b932acb..51e5f56 100644 --- a/documentations/index.rst +++ b/documentations/index.rst @@ -78,6 +78,16 @@ The timeline to reach this goal is: :inherited-members: :autodoc_member_order: + +Recent Changes +============== + +.. git_changelog:: + :rev-list: 9c237402be27af41227f75dbb1fea4bdd9df2165..HEAD + :filename_filter: (doc/.*\.rst|poetry.lock|\.pre-commit-config.yaml|\.github/.*) + +Some other test + Indices and tables ================== * :ref:`genindex` diff --git a/poetry.lock b/poetry.lock index 83264b6..c6b762b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1523,6 +1523,37 @@ files = [ {file = "future-0.18.3.tar.gz", hash = "sha256:34a17436ed1e96697a86f9de3d15a3b0be01d8bc8de9c1dffd59fb8234ed5307"}, ] +[[package]] +name = "gitdb" +version = "4.0.10" +description = "Git Object Database" +optional = false +python-versions = ">=3.7" +files = [ + {file = "gitdb-4.0.10-py3-none-any.whl", hash = "sha256:c286cf298426064079ed96a9e4a9d39e7f3e9bf15ba60701e95f5492f28415c7"}, + {file = "gitdb-4.0.10.tar.gz", hash = "sha256:6eb990b69df4e15bad899ea868dc46572c3f75339735663b81de79b06f17eb9a"}, +] + +[package.dependencies] +smmap = ">=3.0.1,<6" + +[[package]] +name = "gitpython" +version = "3.1.37" +description = "GitPython is a Python library used to interact with Git repositories" +optional = false +python-versions = ">=3.7" +files = [ + {file = "GitPython-3.1.37-py3-none-any.whl", hash = "sha256:5f4c4187de49616d710a77e98ddf17b4782060a1788df441846bddefbb89ab33"}, + {file = "GitPython-3.1.37.tar.gz", hash = "sha256:f9b9ddc0761c125d5780eab2d64be4873fc6817c2899cbcb34b02344bdc7bc54"}, +] + +[package.dependencies] +gitdb = ">=4.0.1,<5" + +[package.extras] +test = ["black", "coverage[toml]", "ddt (>=1.1.1,!=1.4.3)", "mypy", "pre-commit", "pytest", "pytest-cov", "pytest-sugar"] + [[package]] name = "gql" version = "2.0.0" @@ -4940,6 +4971,17 @@ files = [ {file = "slugify-0.0.1.tar.gz", hash = "sha256:c5703cc11c1a6947536f3ce8bb306766b8bb5a84a53717f5a703ce0f18235e4c"}, ] +[[package]] +name = "smmap" +version = "5.0.1" +description = "A pure Python implementation of a sliding window memory map manager" +optional = false +python-versions = ">=3.7" +files = [ + {file = "smmap-5.0.1-py3-none-any.whl", hash = "sha256:e6d8668fa5f93e706934a62d7b4db19c8d9eb8cf2adbb75ef1b675aa332b69da"}, + {file = "smmap-5.0.1.tar.gz", hash = "sha256:dceeb6c0028fdb6734471eb07c0cd2aae706ccaecab45965ee83f11c8d3b1f62"}, +] + [[package]] name = "sniffio" version = "1.3.0" @@ -5055,6 +5097,21 @@ sphinx = ">=1.8" code-style = ["pre-commit (==2.12.1)"] rtd = ["ipython", "myst-nb", "sphinx", "sphinx-book-theme", "sphinx-examples"] +[[package]] +name = "sphinx-git" +version = "11.0.0" +description = "git Changelog for Sphinx" +optional = false +python-versions = "*" +files = [ + {file = "sphinx-git-11.0.0.tar.gz", hash = "sha256:6bf9d837de108c79fb7db585ebd590fd48f4d1f830b540420d0ca675f3b9f800"}, +] + +[package.dependencies] +GitPython = ">=0.3.6" +six = "*" +sphinx = "*" + [[package]] name = "sphinx-notfound-page" version = "1.0.0" @@ -5838,4 +5895,4 @@ web-server = ["dash", "dash-auth", "dash-bootstrap-components", "matplotlib", "s [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "1d21c3be46cb84d7e1bb356735528c06e00f5d635897f22744d65e8781a87d4f" +content-hash = "23ba58b274068d7f1b3f99dee02bc4237d8cf730a1f71f993f159a2d53d1ce54" diff --git a/pyproject.toml b/pyproject.toml index b240d49..a79e819 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -86,6 +86,7 @@ myst-parser = "^1.0.0" nbsphinx = "^0.9.2" sphinx = "*" sphinx-copybutton = "^0.5.2" +sphinx-git = "^11.0.0" sphinx-notfound-page = "^1.0.0" sphinx-rtd-theme = "^1.3.0" sphinx_autodoc_typehints = "*"