Skip to content

Commit

Permalink
use importlib.metadata instead of pkg_resources (#1359)
Browse files Browse the repository at this point in the history
* use importlib.metadata

* explicitly add packaging to requirements for completeness
  • Loading branch information
adehad committed Apr 16, 2022
1 parent 34f6450 commit 39a74e5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions jira/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""The root of JIRA package namespace."""
try:
import pkg_resources
import importlib.metadata

__version__ = pkg_resources.get_distribution("jira").version
__version__ = importlib.metadata.version("jira")
except Exception:
__version__ = "unknown"

Expand Down
2 changes: 1 addition & 1 deletion jira/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
from urllib.parse import parse_qs, quote, urlparse

import requests
from pkg_resources import parse_version
from packaging.version import parse as parse_version
from requests import Response
from requests.auth import AuthBase
from requests.structures import CaseInsensitiveDict
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ setup_requires =
install_requires =
defusedxml
keyring
packaging
requests-oauthlib>=1.1.0
requests>=2.10.0
requests_toolbelt
Expand Down

0 comments on commit 39a74e5

Please sign in to comment.