Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Use importlib.metadata to get version info #2477

Merged
merged 1 commit into from
May 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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