mirror of
https://github.com/jazzband/django-authority.git
synced 2026-05-08 15:44:45 +00:00
Replace deprecated pkg_resources with importlib.metadata
This commit is contained in:
parent
f58bbef27e
commit
234fdc0383
2 changed files with 5 additions and 5 deletions
|
|
@ -1,8 +1,8 @@
|
|||
from pkg_resources import get_distribution, DistributionNotFound
|
||||
from importlib.metadata import PackageNotFoundError, version
|
||||
|
||||
try:
|
||||
__version__ = get_distribution("django-authority").version
|
||||
except DistributionNotFound:
|
||||
__version__ = version("django-authority")
|
||||
except PackageNotFoundError:
|
||||
# package is not installed
|
||||
pass
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
# All configuration values have a default; values that are commented out
|
||||
# serve to show the default.
|
||||
|
||||
from pkg_resources import get_distribution
|
||||
from importlib.metadata import version
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
|
|
@ -46,7 +46,7 @@ copyright = u"2009-2020, Jannis Leidel"
|
|||
# built documents.
|
||||
#
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = get_distribution("django-authority").version
|
||||
release = version("django-authority")
|
||||
# The short X.Y version.
|
||||
version = ".".join(release.split(".")[:2])
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue