deezer-oauth-cli 2.0.0__tar.gz → 2.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {deezer_oauth_cli-2.0.0 → deezer_oauth_cli-2.1.0}/PKG-INFO +2 -2
- {deezer_oauth_cli-2.0.0 → deezer_oauth_cli-2.1.0}/pyproject.toml +4 -3
- deezer_oauth_cli-2.1.0/src/deezer_oauth/__init__.py +1 -0
- {deezer_oauth_cli-2.0.0 → deezer_oauth_cli-2.1.0}/src/deezer_oauth/client.py +2 -2
- {deezer_oauth_cli-2.0.0 → deezer_oauth_cli-2.1.0}/src/deezer_oauth_cli.egg-info/PKG-INFO +2 -2
- {deezer_oauth_cli-2.0.0 → deezer_oauth_cli-2.1.0}/src/deezer_oauth_cli.egg-info/requires.txt +1 -1
- {deezer_oauth_cli-2.0.0 → deezer_oauth_cli-2.1.0}/tests/test_client.py +10 -11
- deezer_oauth_cli-2.0.0/src/deezer_oauth/__init__.py +0 -1
- {deezer_oauth_cli-2.0.0 → deezer_oauth_cli-2.1.0}/LICENSE +0 -0
- {deezer_oauth_cli-2.0.0 → deezer_oauth_cli-2.1.0}/README.md +0 -0
- {deezer_oauth_cli-2.0.0 → deezer_oauth_cli-2.1.0}/setup.cfg +0 -0
- {deezer_oauth_cli-2.0.0 → deezer_oauth_cli-2.1.0}/src/deezer_oauth/__main__.py +0 -0
- {deezer_oauth_cli-2.0.0 → deezer_oauth_cli-2.1.0}/src/deezer_oauth/constants.py +0 -0
- {deezer_oauth_cli-2.0.0 → deezer_oauth_cli-2.1.0}/src/deezer_oauth/files.py +0 -0
- {deezer_oauth_cli-2.0.0 → deezer_oauth_cli-2.1.0}/src/deezer_oauth/main.py +0 -0
- {deezer_oauth_cli-2.0.0 → deezer_oauth_cli-2.1.0}/src/deezer_oauth/py.typed +0 -0
- {deezer_oauth_cli-2.0.0 → deezer_oauth_cli-2.1.0}/src/deezer_oauth/server.py +0 -0
- {deezer_oauth_cli-2.0.0 → deezer_oauth_cli-2.1.0}/src/deezer_oauth_cli.egg-info/SOURCES.txt +0 -0
- {deezer_oauth_cli-2.0.0 → deezer_oauth_cli-2.1.0}/src/deezer_oauth_cli.egg-info/dependency_links.txt +0 -0
- {deezer_oauth_cli-2.0.0 → deezer_oauth_cli-2.1.0}/src/deezer_oauth_cli.egg-info/entry_points.txt +0 -0
- {deezer_oauth_cli-2.0.0 → deezer_oauth_cli-2.1.0}/src/deezer_oauth_cli.egg-info/top_level.txt +0 -0
- {deezer_oauth_cli-2.0.0 → deezer_oauth_cli-2.1.0}/tests/test_dunder_main.py +0 -0
- {deezer_oauth_cli-2.0.0 → deezer_oauth_cli-2.1.0}/tests/test_files.py +0 -0
- {deezer_oauth_cli-2.0.0 → deezer_oauth_cli-2.1.0}/tests/test_main.py +0 -0
- {deezer_oauth_cli-2.0.0 → deezer_oauth_cli-2.1.0}/tests/test_server.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: deezer-oauth-cli
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.1.0
|
|
4
4
|
Summary: A small CLI to quickly obtain an API token for Deezer API.
|
|
5
5
|
Author-email: Bruno Alla <alla.brunoo@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -24,7 +24,7 @@ Classifier: Topic :: Software Development :: Libraries
|
|
|
24
24
|
Requires-Python: >=3.11
|
|
25
25
|
Description-Content-Type: text/markdown
|
|
26
26
|
License-File: LICENSE
|
|
27
|
-
Requires-Dist:
|
|
27
|
+
Requires-Dist: httpx2>=2.16
|
|
28
28
|
Requires-Dist: rich>=10
|
|
29
29
|
Requires-Dist: typer>=0.12
|
|
30
30
|
Dynamic: license-file
|
|
@@ -4,7 +4,7 @@ requires = [ "setuptools>=77.0.3" ]
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "deezer-oauth-cli"
|
|
7
|
-
version = "2.
|
|
7
|
+
version = "2.1.0"
|
|
8
8
|
description = "A small CLI to quickly obtain an API token for Deezer API."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
@@ -26,7 +26,7 @@ classifiers = [
|
|
|
26
26
|
"Topic :: Software Development :: Libraries",
|
|
27
27
|
]
|
|
28
28
|
dependencies = [
|
|
29
|
-
"
|
|
29
|
+
"httpx2>=2.16",
|
|
30
30
|
"rich>=10",
|
|
31
31
|
"typer>=0.12",
|
|
32
32
|
]
|
|
@@ -43,8 +43,9 @@ dev = [
|
|
|
43
43
|
"pyfakefs>=6,<7",
|
|
44
44
|
"pytest>=9,<10",
|
|
45
45
|
"pytest-cov>=7,<8",
|
|
46
|
+
"pytest-httpx2>=1,<2",
|
|
46
47
|
"pytest-mock>=3.6,<4",
|
|
47
|
-
"respx>=0.
|
|
48
|
+
"respx>=0.23",
|
|
48
49
|
"ty==0.0.99",
|
|
49
50
|
]
|
|
50
51
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.1.0"
|
|
@@ -2,7 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
from urllib.parse import parse_qsl, urlencode
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import httpx2
|
|
6
6
|
|
|
7
7
|
from deezer_oauth.constants import HOST_NAME, OAUTH_RETURN_PATH, SERVER_PORT
|
|
8
8
|
|
|
@@ -49,7 +49,7 @@ class OAuthDancer:
|
|
|
49
49
|
}
|
|
50
50
|
)
|
|
51
51
|
url = f"{self.base_url}/oauth/access_token.php?{query}"
|
|
52
|
-
response =
|
|
52
|
+
response = httpx2.get(url, timeout=10)
|
|
53
53
|
content = response.content.decode()
|
|
54
54
|
# The body looks like this: 'access_token=blah&expires=1234'
|
|
55
55
|
# -> parse this as querystring and convert to a dictionary
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: deezer-oauth-cli
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.1.0
|
|
4
4
|
Summary: A small CLI to quickly obtain an API token for Deezer API.
|
|
5
5
|
Author-email: Bruno Alla <alla.brunoo@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -24,7 +24,7 @@ Classifier: Topic :: Software Development :: Libraries
|
|
|
24
24
|
Requires-Python: >=3.11
|
|
25
25
|
Description-Content-Type: text/markdown
|
|
26
26
|
License-File: LICENSE
|
|
27
|
-
Requires-Dist:
|
|
27
|
+
Requires-Dist: httpx2>=2.16
|
|
28
28
|
Requires-Dist: rich>=10
|
|
29
29
|
Requires-Dist: typer>=0.12
|
|
30
30
|
Dynamic: license-file
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING
|
|
4
4
|
|
|
5
5
|
from deezer_oauth.client import OAuthDancer
|
|
6
6
|
|
|
7
|
+
if TYPE_CHECKING:
|
|
8
|
+
import respx
|
|
9
|
+
|
|
7
10
|
|
|
8
11
|
class TestOAuthDancer:
|
|
9
12
|
def test_get_auth_page(self) -> None:
|
|
@@ -17,15 +20,11 @@ class TestOAuthDancer:
|
|
|
17
20
|
"%2Cdelete_library%2Clistening_history"
|
|
18
21
|
)
|
|
19
22
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
get_token_route.mock(
|
|
24
|
-
return_value=httpx.Response(
|
|
25
|
-
status_code=200,
|
|
26
|
-
text="access_token=blah&expires=1234",
|
|
27
|
-
)
|
|
23
|
+
def test_get_token(self, httpx2_mock: respx.MockRouter) -> None:
|
|
24
|
+
get_token_route: respx.Route = httpx2_mock.get(
|
|
25
|
+
"https://connect.deezer.com/oauth/access_token.php"
|
|
28
26
|
)
|
|
27
|
+
get_token_route.respond(200, text="access_token=blah&expires=1234")
|
|
29
28
|
dancer = OAuthDancer(app_id="abcd", app_secret="secret") # noqa S106
|
|
30
29
|
result = dancer.get_token("my-personal-code")
|
|
31
30
|
assert result == {"access_token": "blah", "expires": "1234"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.0.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{deezer_oauth_cli-2.0.0 → deezer_oauth_cli-2.1.0}/src/deezer_oauth_cli.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{deezer_oauth_cli-2.0.0 → deezer_oauth_cli-2.1.0}/src/deezer_oauth_cli.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{deezer_oauth_cli-2.0.0 → deezer_oauth_cli-2.1.0}/src/deezer_oauth_cli.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|