Skip to content

Commit bd7aeb9

Browse files
Copilotdfm
andcommitted
Replace deprecated pkg_resources with importlib.metadata in docs/conf.py
Co-authored-by: dfm <350282+dfm@users.noreply.github.com>
1 parent 94a8db7 commit bd7aeb9

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

docs/conf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import os
2-
from pkg_resources import get_distribution, DistributionNotFound
2+
from importlib.metadata import version as get_version, PackageNotFoundError
33

44
try:
5-
__version__ = get_distribution("daft-pgm").version
6-
except DistributionNotFound:
7-
pass
5+
__version__ = get_version("daft-pgm")
6+
except PackageNotFoundError:
7+
__version__ = "unknown"
88

99
# Support canonical URL
1010
html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "")

0 commit comments

Comments
 (0)