Skip to content

Commit

Permalink
get release / version info from setuptools_scm
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewkern committed Jan 29, 2025
1 parent bf1fb81 commit 2d5ba65
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import datetime
import os
import sys
from setuptools_scm import get_version

sys.path.insert(0, os.path.abspath(".."))
# Add the path for local extensions
Expand All @@ -22,13 +24,16 @@
# -- Project information -----------------------------------------------------

project = "stdpopsim"
copyright = "2019-2022, PopSim Consortium"
copyright = f"2019-{datetime.datetime.now().year}, PopSim Consortium"
author = "PopSim Consortium"

# The short X.Y version
version = ""
# The full version, including alpha/beta/rc tags
release = "0.2.0"
# get the release version from the setuptools_scm
try:
release = get_version(root="..", relative_to=__file__)
version = ".".join(release.split(".")[:2])
except Exception:
release = "unknown"
version = "unknown"


# -- General configuration ---------------------------------------------------
Expand Down Expand Up @@ -93,7 +98,10 @@
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

# Show the version number in the navigation bar
html_show_sphinx = True
html_show_version = True

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand Down

0 comments on commit 2d5ba65

Please sign in to comment.