Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions authority/__init__.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -46,7 +46,7 @@
# 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])

Expand Down