Skip to content

Commit

Permalink
dynamic version RTD
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunsavel committed Feb 22, 2024
1 parent 306aadb commit d639fa1
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions docs/conf.py
Expand Up @@ -37,8 +37,9 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.

META_PATH = os.path.join("..", "src", "simmer", "__init__.py")
# META_PATH = os.path.join("..", "src", "simmer", "__init__.py")
HERE = os.path.abspath(os.path.dirname(__file__))
from simmer import __version__


def read(*parts):
Expand All @@ -50,19 +51,6 @@ def read(*parts):
return f.read()


def find_meta(meta):
"""
Extract __*meta*__ from META_FILE.
"""
meta_match = re.search(
r"^__{meta}__ = ['\"]([^'\"]*)['\"]".format(meta=meta), META_FILE, re.M
)
if meta_match:
return meta_match.group(1)
raise RuntimeError("Unable to find __{meta}__ string.".format(meta=meta))


META_FILE = read(META_PATH)

extensions = [
"sphinx.ext.autodoc",
Expand Down Expand Up @@ -108,9 +96,9 @@ def find_meta(meta):
# built documents.
#
# The short X.Y version.
version = find_meta("version")
version = __version__
# The full version, including alpha/beta/rc tags.
release = find_meta("release")
release = version

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -214,7 +202,7 @@ def find_meta(meta):
"SImMER Documentation",
author,
"SImMER",
find_meta("description"),
"Stellar Image Maturation via Efficient Reduction",
"Miscellaneous",
)
]

0 comments on commit d639fa1

Please sign in to comment.