def get_version():
    import configparser
    import pathlib

    cp = configparser.ConfigParser()
    cp.read(pathlib.Path(__file__).parent.parent / "setup.cfg")
    return cp["metadata"]["version"]


project = "cachetools"
copyright = "2014-2022 Thomas Kemmer"
version = get_version()
release = version

extensions = [
    "sphinx.ext.autodoc",
    "sphinx.ext.coverage",
    "sphinx.ext.doctest",
    "sphinx.ext.todo",
]
exclude_patterns = ["_build"]
master_doc = "index"
html_theme = "default"

import pathlib
import sys

basedir = pathlib.Path(__file__).parent.parent

sys.path.insert(0, str((basedir / "src").resolve()))


def get_version():
    import configparser

    cp = configparser.ConfigParser()
    cp.read(basedir / "setup.cfg")
    return cp["metadata"]["version"]


project = "cachetools"
copyright = "2014-2022 Thomas Kemmer"
version = get_version()
release = version

extensions = [
    "sphinx.ext.autodoc",
    "sphinx.ext.coverage",
    "sphinx.ext.doctest",
    "sphinx.ext.todo",
]
exclude_patterns = ["_build"]
master_doc = "index"
html_theme = "default"

Fix #242: Add src directory to sys.path for sphinx autodoc.