Skip to content

Commit f8b37ad

Browse files
committed
updated version to come from importlib
1 parent f58fe94 commit f8b37ad

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

cf_pandas/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
cf-pandas: an accessor for pandas objects that interprets CF attributes
33
"""
44

5-
from pkg_resources import DistributionNotFound, get_distribution
5+
from importlib.metadata import PackageNotFoundError, version
66

77
from .accessor import CFAccessor # noqa
88
from .options import set_options # noqa
@@ -12,7 +12,7 @@
1212
from .widget import Selector, dropdown
1313

1414
try:
15-
__version__ = get_distribution("cf-pandas").version
16-
except DistributionNotFound:
15+
__version__ = version("cf-pandas")
16+
except PackageNotFoundError:
1717
# package is not installed
18-
__version__ = "unknown"
18+
pass

docs/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# |version| and |release|, also used in various other places throughout the
1919
# built documents.
2020
# see https://pypi.org/project/setuptools-scm/ for details
21-
from pkg_resources import get_distribution
21+
from importlib.metadata import version as imversion
2222

2323
print("python exec:", sys.executable)
2424
print("sys.path:", sys.path)
@@ -31,10 +31,10 @@
3131
# -- Project information -----------------------------------------------------
3232

3333
project = "cf-pandas"
34-
copyright = "2022, Axiom Data Science"
34+
copyright = "2022–2023, Axiom Data Science"
3535
author = "Axiom Data Science"
3636

37-
release = get_distribution("cf_pandas").version
37+
release = imversion("cf-pandas")
3838
# for example take major/minor
3939
version = ".".join(release.split(".")[:2])
4040

0 commit comments

Comments
 (0)