Skip to content

Commit 853e1e7

Browse files
vinayinvicibleauvipy
authored andcommitted
Moved version info from setup.cfg into package
It is better to make setup.cfg infer version info from the package instead of vice versa. Previous method only works where the package is "installed". It doesn't work if we were to use this as a git submodule or frozen environments like nuitka.
1 parent 20ed234 commit 853e1e7

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

oauth2_provider/__init__.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
try:
2-
from importlib.metadata import version
3-
except ImportError:
4-
from importlib_metadata import version
5-
6-
7-
__version__ = version("django-oauth-toolkit")
1+
__version__ = "1.5.0"
82

93
default_app_config = "oauth2_provider.apps.DOTConfig"

setup.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = django-oauth-toolkit
3-
version = 1.5.0
3+
version = attr: oauth2_provider.__version__
44
description = OAuth2 Provider for Django
55
long_description = file: README.rst
66
long_description_content_type = text/x-rst
@@ -36,7 +36,6 @@ install_requires =
3636
requests >= 2.13.0
3737
oauthlib >= 3.1.0
3838
jwcrypto >= 0.8.0
39-
importlib-metadata; python_version < "3.8"
4039

4140
[options.packages.find]
4241
exclude = tests

0 commit comments

Comments
 (0)