Skip to content

Commit 096d555

Browse files
authored
Fix deprecation warning issue (#66)
As `pkg_resources` was deprecated we switched to `importlib.metadata` to get the same data.
1 parent fc7895b commit 096d555

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

phpypam/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
"""Package that provides phpIPAM API interface."""
2-
from pkg_resources import get_distribution, DistributionNotFound
2+
import importlib.metadata
33

44
from phpypam.core.api import Api as api
55
from phpypam.core.exceptions import PHPyPAMEntityNotFoundException
66

77
try:
8-
__version__ = get_distribution(__name__).version
9-
except DistributionNotFound:
8+
__version__ = importlib.metadata.version(__name__)
9+
except importlib.metadata.PackageNotFoundError:
10+
1011
pass

0 commit comments

Comments
 (0)