deezer-oauth-cli 1.8.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.
Files changed (25) hide show
  1. {deezer_oauth_cli-1.8.0 → deezer_oauth_cli-2.1.0}/PKG-INFO +3 -4
  2. {deezer_oauth_cli-1.8.0 → deezer_oauth_cli-2.1.0}/pyproject.toml +6 -6
  3. deezer_oauth_cli-2.1.0/src/deezer_oauth/__init__.py +1 -0
  4. {deezer_oauth_cli-1.8.0 → deezer_oauth_cli-2.1.0}/src/deezer_oauth/client.py +2 -2
  5. {deezer_oauth_cli-1.8.0 → deezer_oauth_cli-2.1.0}/src/deezer_oauth/server.py +2 -4
  6. {deezer_oauth_cli-1.8.0 → deezer_oauth_cli-2.1.0}/src/deezer_oauth_cli.egg-info/PKG-INFO +3 -4
  7. {deezer_oauth_cli-1.8.0 → deezer_oauth_cli-2.1.0}/src/deezer_oauth_cli.egg-info/requires.txt +1 -1
  8. {deezer_oauth_cli-1.8.0 → deezer_oauth_cli-2.1.0}/tests/test_client.py +10 -11
  9. deezer_oauth_cli-1.8.0/src/deezer_oauth/__init__.py +0 -1
  10. {deezer_oauth_cli-1.8.0 → deezer_oauth_cli-2.1.0}/LICENSE +0 -0
  11. {deezer_oauth_cli-1.8.0 → deezer_oauth_cli-2.1.0}/README.md +0 -0
  12. {deezer_oauth_cli-1.8.0 → deezer_oauth_cli-2.1.0}/setup.cfg +0 -0
  13. {deezer_oauth_cli-1.8.0 → deezer_oauth_cli-2.1.0}/src/deezer_oauth/__main__.py +0 -0
  14. {deezer_oauth_cli-1.8.0 → deezer_oauth_cli-2.1.0}/src/deezer_oauth/constants.py +0 -0
  15. {deezer_oauth_cli-1.8.0 → deezer_oauth_cli-2.1.0}/src/deezer_oauth/files.py +0 -0
  16. {deezer_oauth_cli-1.8.0 → deezer_oauth_cli-2.1.0}/src/deezer_oauth/main.py +0 -0
  17. {deezer_oauth_cli-1.8.0 → deezer_oauth_cli-2.1.0}/src/deezer_oauth/py.typed +0 -0
  18. {deezer_oauth_cli-1.8.0 → deezer_oauth_cli-2.1.0}/src/deezer_oauth_cli.egg-info/SOURCES.txt +0 -0
  19. {deezer_oauth_cli-1.8.0 → deezer_oauth_cli-2.1.0}/src/deezer_oauth_cli.egg-info/dependency_links.txt +0 -0
  20. {deezer_oauth_cli-1.8.0 → deezer_oauth_cli-2.1.0}/src/deezer_oauth_cli.egg-info/entry_points.txt +0 -0
  21. {deezer_oauth_cli-1.8.0 → deezer_oauth_cli-2.1.0}/src/deezer_oauth_cli.egg-info/top_level.txt +0 -0
  22. {deezer_oauth_cli-1.8.0 → deezer_oauth_cli-2.1.0}/tests/test_dunder_main.py +0 -0
  23. {deezer_oauth_cli-1.8.0 → deezer_oauth_cli-2.1.0}/tests/test_files.py +0 -0
  24. {deezer_oauth_cli-1.8.0 → deezer_oauth_cli-2.1.0}/tests/test_main.py +0 -0
  25. {deezer_oauth_cli-1.8.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: 1.8.0
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
@@ -15,17 +15,16 @@ Classifier: Intended Audience :: Developers
15
15
  Classifier: Natural Language :: English
16
16
  Classifier: Operating System :: OS Independent
17
17
  Classifier: Programming Language :: Python :: 3 :: Only
18
- Classifier: Programming Language :: Python :: 3.10
19
18
  Classifier: Programming Language :: Python :: 3.11
20
19
  Classifier: Programming Language :: Python :: 3.12
21
20
  Classifier: Programming Language :: Python :: 3.13
22
21
  Classifier: Programming Language :: Python :: 3.14
23
22
  Classifier: Programming Language :: Python :: 3.15
24
23
  Classifier: Topic :: Software Development :: Libraries
25
- Requires-Python: >=3.10
24
+ Requires-Python: >=3.11
26
25
  Description-Content-Type: text/markdown
27
26
  License-File: LICENSE
28
- Requires-Dist: httpx>=0.27
27
+ Requires-Dist: httpx2>=2.16
29
28
  Requires-Dist: rich>=10
30
29
  Requires-Dist: typer>=0.12
31
30
  Dynamic: license-file
@@ -4,21 +4,20 @@ requires = [ "setuptools>=77.0.3" ]
4
4
 
5
5
  [project]
6
6
  name = "deezer-oauth-cli"
7
- version = "1.8.0"
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"
11
11
  authors = [
12
12
  { name = "Bruno Alla", email = "alla.brunoo@gmail.com" },
13
13
  ]
14
- requires-python = ">=3.10"
14
+ requires-python = ">=3.11"
15
15
  classifiers = [
16
16
  "Development Status :: 2 - Pre-Alpha",
17
17
  "Intended Audience :: Developers",
18
18
  "Natural Language :: English",
19
19
  "Operating System :: OS Independent",
20
20
  "Programming Language :: Python :: 3 :: Only",
21
- "Programming Language :: Python :: 3.10",
22
21
  "Programming Language :: Python :: 3.11",
23
22
  "Programming Language :: Python :: 3.12",
24
23
  "Programming Language :: Python :: 3.13",
@@ -27,7 +26,7 @@ classifiers = [
27
26
  "Topic :: Software Development :: Libraries",
28
27
  ]
29
28
  dependencies = [
30
- "httpx>=0.27",
29
+ "httpx2>=2.16",
31
30
  "rich>=10",
32
31
  "typer>=0.12",
33
32
  ]
@@ -44,9 +43,10 @@ dev = [
44
43
  "pyfakefs>=6,<7",
45
44
  "pytest>=9,<10",
46
45
  "pytest-cov>=7,<8",
46
+ "pytest-httpx2>=1,<2",
47
47
  "pytest-mock>=3.6,<4",
48
- "respx>=0.22",
49
- "ty==0.0.69",
48
+ "respx>=0.23",
49
+ "ty==0.0.99",
50
50
  ]
51
51
 
52
52
  [tool.ruff]
@@ -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 httpx
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 = httpx.get(url, timeout=10)
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,7 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  from http.server import BaseHTTPRequestHandler, HTTPServer
4
- from typing import TYPE_CHECKING, Any
4
+ from typing import TYPE_CHECKING, Any, cast
5
5
  from urllib.parse import parse_qsl
6
6
 
7
7
  from deezer_oauth.constants import HOST_NAME, OAUTH_RETURN_PATH, SERVER_PORT
@@ -53,12 +53,10 @@ PAGE_CONTENT = """
53
53
  class LocalRequestHandler(BaseHTTPRequestHandler):
54
54
  """Simple HTTP request handler to perform the OAuth dance."""
55
55
 
56
- server: LocalHTTPServer
57
-
58
56
  @property
59
57
  def oauth_dancer(self) -> OAuthDancer:
60
58
  """Shortcut to access the `OAuthDancer` instance."""
61
- return self.server.oauth_dancer
59
+ return cast(LocalHTTPServer, self.server).oauth_dancer
62
60
 
63
61
  def do_GET(self) -> None:
64
62
  """Route GET requests to the right handler."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deezer-oauth-cli
3
- Version: 1.8.0
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
@@ -15,17 +15,16 @@ Classifier: Intended Audience :: Developers
15
15
  Classifier: Natural Language :: English
16
16
  Classifier: Operating System :: OS Independent
17
17
  Classifier: Programming Language :: Python :: 3 :: Only
18
- Classifier: Programming Language :: Python :: 3.10
19
18
  Classifier: Programming Language :: Python :: 3.11
20
19
  Classifier: Programming Language :: Python :: 3.12
21
20
  Classifier: Programming Language :: Python :: 3.13
22
21
  Classifier: Programming Language :: Python :: 3.14
23
22
  Classifier: Programming Language :: Python :: 3.15
24
23
  Classifier: Topic :: Software Development :: Libraries
25
- Requires-Python: >=3.10
24
+ Requires-Python: >=3.11
26
25
  Description-Content-Type: text/markdown
27
26
  License-File: LICENSE
28
- Requires-Dist: httpx>=0.27
27
+ Requires-Dist: httpx2>=2.16
29
28
  Requires-Dist: rich>=10
30
29
  Requires-Dist: typer>=0.12
31
30
  Dynamic: license-file
@@ -1,3 +1,3 @@
1
- httpx>=0.27
1
+ httpx2>=2.16
2
2
  rich>=10
3
3
  typer>=0.12
@@ -1,9 +1,12 @@
1
- import httpx
2
- import pytest
3
- import respx
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
- @pytest.mark.respx(base_url="https://connect.deezer.com")
21
- def test_get_token(self, respx_mock: respx.MockRouter) -> None:
22
- get_token_route: respx.Route = respx_mock.get("/oauth/access_token.php")
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__ = "1.8.0"