Skip to content

Commit

Permalink
3
Browse files Browse the repository at this point in the history
  • Loading branch information
olofk committed Oct 7, 2024
1 parent 657eca0 commit c4dded0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@
except ImportError:
__version__ = "unknown"

release = __version__
print(f"Release is '{release}'")
# The short X.Y version.
version = f"{release.split('.')[0]}.{release.split('.')[1]}"
from importlib.metadata import version as get_version

release: str = get_version("package-name")
# for example take major/minor
version: str = ".".join(release.split(".")[:2])

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

Expand Down

0 comments on commit c4dded0

Please sign in to comment.