Use importlib.metadata instead of pkg_resources to get version

This commit is contained in:
Brian Helba 2021-10-25 13:14:45 -04:00
parent 62d34c2a16
commit 4bd4cf5dd4
2 changed files with 3 additions and 4 deletions

View file

@ -1,7 +1,7 @@
from pkg_resources import get_distribution, DistributionNotFound
from importlib.metadata import PackageNotFoundError, version
try:
__version__ = get_distribution("django-configurations").version
except DistributionNotFound:
__version__ = version("django-configurations")
except PackageNotFoundError:
# package is not installed
__version__ = None

View file

@ -28,7 +28,6 @@ setup(
},
install_requires=[
'django>=2.2',
'setuptools',
],
extras_require={
'cache': ['django-cache-url'],