Skip to content

Commit

Permalink
Backport PR scikit-hep#2477: docs: Use importlib.metadata to get vers…
Browse files Browse the repository at this point in the history
…ion info
  • Loading branch information
matthewfeickert authored and meeseeksmachine committed May 30, 2024
1 parent 1dec306 commit 956d204
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use Path('../relative_path_to_dir').resolve() to make it absolute, like shown here.

import importlib.metadata
import sys
from pathlib import Path

import jupytext
from pkg_resources import get_distribution

sys.path.insert(0, str(Path('./exts').resolve()))

Expand Down Expand Up @@ -123,7 +123,7 @@ def setup(app):
# |version| and |release|, also used in various other places throughout the
# built documents.
# The full version, including alpha/beta/rc tags.
release = get_distribution('pyhf').version
release = importlib.metadata.version("pyhf")
# for example take major/minor/patch
version = '.'.join(release.split('.')[:3])

Expand Down

0 comments on commit 956d204

Please sign in to comment.