Skip to content

Commit

Permalink
Fix version detection in Sphinx config
Browse files Browse the repository at this point in the history
  • Loading branch information
olofk committed Oct 7, 2024
1 parent 5c8d94f commit 917a1ce
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import os
import sys
from datetime import datetime
from distutils.version import LooseVersion

import jsonschema2md

Expand All @@ -35,16 +34,13 @@
copyright = f"2018-{datetime.now().year}, Olof Kindgren"
author = "Olof Kindgren"

from importlib.metadata import version as get_version

# The full version, including alpha/beta/rc tags.
try:
from fusesoc.version import version as __version__
except ImportError:
__version__ = "unknown"
release: str = get_version("fusesoc")

release = __version__
# The short X.Y version.
v_major, v_minor = LooseVersion(release).version[:2]
version = f"{v_major}.{v_minor}"
version: str = ".".join(release.split(".")[:2])

# -- General configuration ---------------------------------------------------

Expand All @@ -67,7 +63,7 @@
"myst_parser",
]

intersphinx_mapping = {"https://docs.python.org/3": None}
intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}


# Add any paths that contain templates here, relative to this directory.
Expand Down

0 comments on commit 917a1ce

Please sign in to comment.