Skip to content

Commit 65c4d96

Browse files
Copilotdfm
andauthored
Replace pkg_resources with importlib.metadata in docs config (#564)
* Initial plan * Replace pkg_resources with importlib.metadata in docs/conf.py Co-authored-by: dfm <350282+dfm@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: dfm <350282+dfm@users.noreply.github.com>
1 parent 832efe1 commit 65c4d96

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

docs/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# -*- coding: utf-8 -*-
22

3-
from pkg_resources import DistributionNotFound, get_distribution
3+
from importlib.metadata import PackageNotFoundError, version
44

55
try:
6-
__version__ = get_distribution("emcee").version
7-
except DistributionNotFound:
6+
__version__ = version("emcee")
7+
except PackageNotFoundError:
88
__version__ = "unknown version"
99

1010

docs/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@ h5py
66
celerite
77
corner
88
ipython
9-
setuptools

0 commit comments

Comments
 (0)