1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
import pathlib
def get_version() -> str:
path = pathlib.Path(__file__).parent.parent / "sqlalchemy_utils/__init__.py"
content = path.read_text()
for line in content.splitlines():
if line.strip().startswith("__version__"):
_, _, version_ = line.partition("=")
return version_.strip("'\" ")
# -- General configuration -----------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
"sphinx.ext.todo",
"sphinx.ext.coverage",
"sphinx.ext.ifconfig",
"sphinx.ext.viewcode",
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
# The master toctree document.
master_doc = "index"
# General information about the project.
project = "SQLAlchemy-Utils"
copyright = "2013-2022, Konsta Vesterinen"
version = get_version()
release = version
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ["_build"]
# The name of the Pygments (syntax highlighting) style to use.
# pygments_style = "sphinx"
html_theme = "sphinx_rtd_theme"
|