Skip to content

Commit

Permalink
Fetch version from importlib metadata during sphinx build
Browse files Browse the repository at this point in the history
  • Loading branch information
lucc committed Aug 14, 2024
1 parent 5460c03 commit a074fbb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# alot documentation build configuration file
import pathlib
import tomllib
import importlib.metadata

pyproject = pathlib.Path(__file__).parent.parent.parent / "pyproject.toml"
with pyproject.open("rb") as f:
Expand Down Expand Up @@ -54,9 +55,9 @@
# built documents.
#
# The short X.Y version.
version = project_data["version"]
version = importlib.metadata.version("alot")
# The full version, including alpha/beta/rc tags.
release = project_data["version"]
release = importlib.metadata.version("alot")

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down

0 comments on commit a074fbb

Please sign in to comment.