Skip to content

Commit 0394bff

Browse files
vinayinvicibleauvipy
authored andcommitted
Replaced pkg_resources usage with importlib.metadata
1 parent ab74586 commit 0394bff

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,4 @@ Jadiel Teófilo
6060
pySilver
6161
Łukasz Skarżyński
6262
Shaheed Haque
63+
Vinay Karanam

oauth2_provider/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
import pkg_resources
1+
try:
2+
from importlib.metadata import version
3+
except ImportError:
4+
from importlib_metadata import version
25

36

4-
__version__ = pkg_resources.require("django-oauth-toolkit")[0].version
7+
__version__ = version("django-oauth-toolkit")
58

69
default_app_config = "oauth2_provider.apps.DOTConfig"

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ install_requires =
3636
requests >= 2.13.0
3737
oauthlib >= 3.1.0
3838
jwcrypto >= 0.8.0
39+
importlib-metadata; python_version < "3.8"
3940
six
4041

4142
[options.packages.find]

0 commit comments

Comments
 (0)