Skip to content

Commit

Permalink
🐛 (docs): Parse version from pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
vict0rsch committed Nov 14, 2023
1 parent 93bf8b3 commit 8f93ca0
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,23 @@

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'gitmopy'
copyright = '2023, vict0rsch'
author = 'vict0rsch'

version = '0.4.1'
release = '0.4.1'

import sys
from pathlib import Path

project = "gitmopy"
copyright = "2023, vict0rsch"
author = "vict0rsch"

ROOT = Path(__file__).resolve().parent.parent
sys.path.insert(0, str(ROOT))

version = [
line.split("=")[-1].strip().replace('"', "")
for line in (ROOT / "pyproject.toml").read_text().splitlines()
if line.startswith("version = ")
][0]
release = version

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

Expand All @@ -39,23 +42,22 @@
]


templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

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 = "furo"
html_static_path = ['_static']
html_static_path = ["_static"]
html_css_files = ["css/custom.css"]

# -- Options for intersphinx extension ---------------------------------------
# https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html#configuration

intersphinx_mapping = {
'python': ('https://docs.python.org/3', None),
"python": ("https://docs.python.org/3", None),
}

# -- Options for todo extension ----------------------------------------------
Expand All @@ -72,7 +74,7 @@

autodoc_typehints = "description"
autoapi_type = "python"
autoapi_dirs = [str(ROOT/ "gitmopy")]
autoapi_dirs = [str(ROOT / "gitmopy")]
autoapi_member_order = "groupwise"
autoapi_template_dir = "_templates/autoapi"
autoapi_python_class_content = "init"
Expand Down Expand Up @@ -119,4 +121,3 @@
"enable": True,
"image": "./_static/images/SOME_IMAGE",
}

0 comments on commit 8f93ca0

Please sign in to comment.