| 1 |
# Configuration file for the Sphinx documentation builder. |
| 2 |
# |
| 3 |
# For the full list of built-in configuration values, see the documentation: |
| 4 |
# https://www.sphinx-doc.org/en/master/usage/configuration.html |
| 5 |
|
| 6 |
# -- Project information ----------------------------------------------------- |
| 7 |
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information |
| 8 |
|
| 9 |
import os |
| 10 |
import sys |
| 11 |
from importlib.metadata import PackageNotFoundError, version as pkg_version |
| 12 |
|
| 13 |
|
| 14 |
def get_release(): |
| 15 |
"""Determine the borgstore version, without requiring borgstore to be installed.""" |
| 16 |
try: |
| 17 |
return pkg_version("borgstore") |
| 18 |
except PackageNotFoundError: |
| 19 |
pass |
| 20 |
# not installed - maybe we are in a source tree where setuptools_scm already generated _version.py. |
| 21 |
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) |
| 22 |
try: |
| 23 |
from borgstore._version import version # noqa |
| 24 |
|
| 25 |
return version |
| 26 |
except ImportError: |
| 27 |
# neither installed nor built - the docs do not really need the version, so just go on without it. |
| 28 |
return "" |
| 29 |
|
| 30 |
|
| 31 |
project = "BorgStore" |
| 32 |
copyright = "2026, Thomas Waldmann" |
| 33 |
author = "Thomas Waldmann" |
| 34 |
release = get_release() |
| 35 |
version = ".".join(release.split(".")[:2]) |
| 36 |
|
| 37 |
# -- General configuration --------------------------------------------------- |
| 38 |
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration |
| 39 |
|
| 40 |
extensions = [] |
| 41 |
|
| 42 |
templates_path = ["_templates"] |
| 43 |
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] |
| 44 |
|
| 45 |
|
| 46 |
# -- Options for HTML output ------------------------------------------------- |
| 47 |
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output |
| 48 |
|
| 49 |
html_theme = "alabaster" |
| 50 |
html_static_path = ["_static"] |
| 51 |
html_show_sphinx = False |