Skip to content

Commit 6619b06

Browse files
committed
removed pkg_resources dependency and added unit tests for the fix
1 parent f6efae2 commit 6619b06

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

uid2_client/request_response_util.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,22 @@
33
from datetime import datetime
44
from typing import Dict, Optional
55
from urllib import request
6-
7-
import pkg_resources
6+
from importlib import metadata
87

98
from uid2_client.encryption import _encrypt_gcm, _decrypt_gcm
109
from .envelope import Envelope
1110
from .uid2_response import Uid2Response
1211

1312
BINARY = 'application/octet-stream'
1413

14+
1515
def _make_url(base_url: str, path: str) -> str:
1616
return base_url + path
1717

18+
1819
def auth_headers(auth_key: str) -> Dict[str, str]:
1920
try:
20-
version = pkg_resources.get_distribution("uid2_client").version
21+
version = metadata.version("uid2_client")
2122
except Exception:
2223
version = "non-packaged-mode"
2324

0 commit comments

Comments
 (0)