diff --git a/zuul_sphinx/version.py b/zuul_sphinx/version.py index b57c528..e0c7831 100644 --- a/zuul_sphinx/version.py +++ b/zuul_sphinx/version.py @@ -14,17 +14,15 @@ import json -import pbr.version -import pkg_resources +from importlib import metadata as importlib_metadata -version_info = pbr.version.VersionInfo('zuul-sphinx') -release_string = version_info.release_string() +zuul_sphinx_distribution = importlib_metadata.distribution('zuul-sphinx') +release_string = zuul_sphinx_distribution.version is_release = None git_version = None try: - _metadata = json.loads( - pkg_resources.get_distribution('zuul-sphinx').get_metadata('pbr.json')) + _metadata = json.loads(zuul_distribution.read_text('pbr.json')) if _metadata: is_release = _metadata['is_release'] git_version = _metadata['git_version']