depsdev 0.0.2__py3-none-any.whl → 0.0.3__py3-none-any.whl
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.
- depsdev/__main__.py +11 -9
- depsdev/_version.py +2 -2
- depsdev/v3.py +8 -1
- {depsdev-0.0.2.dist-info → depsdev-0.0.3.dist-info}/METADATA +3 -1
- depsdev-0.0.3.dist-info/RECORD +11 -0
- depsdev-0.0.2.dist-info/RECORD +0 -11
- {depsdev-0.0.2.dist-info → depsdev-0.0.3.dist-info}/WHEEL +0 -0
- {depsdev-0.0.2.dist-info → depsdev-0.0.3.dist-info}/entry_points.txt +0 -0
- {depsdev-0.0.2.dist-info → depsdev-0.0.3.dist-info}/licenses/LICENSE.txt +0 -0
depsdev/__main__.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
|
3
|
+
import logging
|
3
4
|
import os
|
4
5
|
from textwrap import dedent
|
5
6
|
from typing import TYPE_CHECKING
|
@@ -14,6 +15,14 @@ if TYPE_CHECKING:
|
|
14
15
|
R = TypeVar("R")
|
15
16
|
|
16
17
|
|
18
|
+
logging.basicConfig(
|
19
|
+
level=logging.ERROR,
|
20
|
+
format="[%(asctime)s] [%(levelname)-7s] [%(name)s] %(message)s",
|
21
|
+
)
|
22
|
+
logging.getLogger("httpx").setLevel(logging.WARNING)
|
23
|
+
logger = logging.getLogger("depsdev")
|
24
|
+
|
25
|
+
|
17
26
|
def to_sync() -> Callable[[Callable[P, R]], Callable[P, R]]:
|
18
27
|
"""
|
19
28
|
Decorator to convert async methods to sync methods.
|
@@ -30,7 +39,8 @@ def to_sync() -> Callable[[Callable[P, R]], Callable[P, R]]:
|
|
30
39
|
from rich import print_json
|
31
40
|
|
32
41
|
print_json(data=asyncio.run(func(*args, **kwargs))) # type: ignore[arg-type]
|
33
|
-
except
|
42
|
+
except Exception:
|
43
|
+
logger.exception("An error occurred while executing the command.")
|
34
44
|
raise SystemExit(1) from None
|
35
45
|
|
36
46
|
raise SystemExit(0)
|
@@ -44,14 +54,6 @@ def main() -> None:
|
|
44
54
|
"""
|
45
55
|
Main entry point for the CLI.
|
46
56
|
"""
|
47
|
-
import logging
|
48
|
-
|
49
|
-
logging.basicConfig(
|
50
|
-
level=logging.ERROR,
|
51
|
-
format="[%(asctime)s] [%(levelname)-7s] [%(name)s] %(message)s",
|
52
|
-
)
|
53
|
-
logging.getLogger("httpx").setLevel(logging.WARNING)
|
54
|
-
logger = logging.getLogger("depsdev")
|
55
57
|
|
56
58
|
try:
|
57
59
|
import typer
|
depsdev/_version.py
CHANGED
depsdev/v3.py
CHANGED
@@ -24,6 +24,9 @@ class HashType(str, Enum):
|
|
24
24
|
SHA256 = "SHA256"
|
25
25
|
SHA512 = "SHA512"
|
26
26
|
|
27
|
+
def __str__(self) -> str:
|
28
|
+
return self.value
|
29
|
+
|
27
30
|
|
28
31
|
class System(str, Enum):
|
29
32
|
GO = "GO"
|
@@ -34,6 +37,9 @@ class System(str, Enum):
|
|
34
37
|
PYPI = "PYPI"
|
35
38
|
NUGET = "NUGET"
|
36
39
|
|
40
|
+
def __str__(self) -> str:
|
41
|
+
return self.value
|
42
|
+
|
37
43
|
|
38
44
|
def url_escape(string: str) -> str:
|
39
45
|
return quote(string, safe="")
|
@@ -41,7 +47,7 @@ def url_escape(string: str) -> str:
|
|
41
47
|
|
42
48
|
@dataclass
|
43
49
|
class DepsDevClientV3:
|
44
|
-
client: httpx.AsyncClient = field(init=False)
|
50
|
+
client: httpx.AsyncClient = field(init=False, repr=False)
|
45
51
|
timeout: float = 5.0
|
46
52
|
base_url: str = "https://api.deps.dev"
|
47
53
|
|
@@ -55,6 +61,7 @@ class DepsDevClientV3:
|
|
55
61
|
params: QueryParamTypes | None = None,
|
56
62
|
json: object | None = None,
|
57
63
|
) -> Incomplete:
|
64
|
+
logger.info(locals())
|
58
65
|
response = await self.client.request(method=method, url=url, params=params, json=json)
|
59
66
|
if not response.is_success:
|
60
67
|
logger.error(
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: depsdev
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.3
|
4
4
|
Summary: Python wrapper for https://deps.dev/ API
|
5
5
|
Project-URL: Documentation, https://github.com/FlavioAmurrioCS/depsdev#readme
|
6
6
|
Project-URL: Issues, https://github.com/FlavioAmurrioCS/depsdev/issues
|
@@ -25,6 +25,7 @@ Requires-Dist: rich; extra == 'cli'
|
|
25
25
|
Requires-Dist: typer-slim; extra == 'cli'
|
26
26
|
Provides-Extra: tests
|
27
27
|
Requires-Dist: pytest; extra == 'tests'
|
28
|
+
Requires-Dist: pytest-asyncio; extra == 'tests'
|
28
29
|
Requires-Dist: rich; extra == 'tests'
|
29
30
|
Requires-Dist: tomli; (python_version < '3.11') and extra == 'tests'
|
30
31
|
Requires-Dist: typer-slim; extra == 'tests'
|
@@ -33,6 +34,7 @@ Requires-Dist: mypy; extra == 'types'
|
|
33
34
|
Requires-Dist: pyrefly; extra == 'types'
|
34
35
|
Requires-Dist: pyright[nodejs]; extra == 'types'
|
35
36
|
Requires-Dist: pytest; extra == 'types'
|
37
|
+
Requires-Dist: pytest-asyncio; extra == 'types'
|
36
38
|
Requires-Dist: rich; extra == 'types'
|
37
39
|
Requires-Dist: tomli; (python_version < '3.11') and extra == 'types'
|
38
40
|
Requires-Dist: ty; extra == 'types'
|
@@ -0,0 +1,11 @@
|
|
1
|
+
depsdev/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
depsdev/__main__.py,sha256=tBzB1uTUuMYu61aW4QpgdClhf4C7IgQ8EQzT_K21JXE,4578
|
3
|
+
depsdev/_version.py,sha256=7Bz8oZwdLt8FP3QYrq7kiW8zbcYkC4dpOMGsCBlZ_8Y,511
|
4
|
+
depsdev/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
|
+
depsdev/v3.py,sha256=vLkOYzT3wx5YuEnjwI1t7mcXXCbGmSVsoK4V1GbUGLc,7896
|
6
|
+
depsdev/v3alpha.py,sha256=KUl8Fq9mLExAfrU5T43vAc1dlRBbugN3H2Eg4Tv5XxE,13908
|
7
|
+
depsdev-0.0.3.dist-info/METADATA,sha256=eYFZho9-afdPDY8MnRQtkIN6ZuAXfuyKcAWtSdIJJIM,2998
|
8
|
+
depsdev-0.0.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
9
|
+
depsdev-0.0.3.dist-info/entry_points.txt,sha256=yVCFtXda2xhj-7SmKEw7ynA_8QJrmKi9tORDw2uco9Q,50
|
10
|
+
depsdev-0.0.3.dist-info/licenses/LICENSE.txt,sha256=jpNC8_qYxlJENCgo7GKooe4rsIx-t_wIWl7ngr03F2k,1131
|
11
|
+
depsdev-0.0.3.dist-info/RECORD,,
|
depsdev-0.0.2.dist-info/RECORD
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
depsdev/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
depsdev/__main__.py,sha256=iLGic-dGQX0SdzL3KJOibUdG1J7nFSvighn9E2nP29w,4526
|
3
|
-
depsdev/_version.py,sha256=wO7XWlZte1hxA4mMvRc6zhNdGm74Nhhn2bfWRAxaKbI,511
|
4
|
-
depsdev/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
|
-
depsdev/v3.py,sha256=9MPK2h6QmxKnBz8KNF2GPTRlClOlM7xWO6TbtnRiQbE,7740
|
6
|
-
depsdev/v3alpha.py,sha256=KUl8Fq9mLExAfrU5T43vAc1dlRBbugN3H2Eg4Tv5XxE,13908
|
7
|
-
depsdev-0.0.2.dist-info/METADATA,sha256=nPf24oXHCDXIfkWGgoElJRiXS8RO7NoE14QByGS9-sw,2902
|
8
|
-
depsdev-0.0.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
9
|
-
depsdev-0.0.2.dist-info/entry_points.txt,sha256=yVCFtXda2xhj-7SmKEw7ynA_8QJrmKi9tORDw2uco9Q,50
|
10
|
-
depsdev-0.0.2.dist-info/licenses/LICENSE.txt,sha256=jpNC8_qYxlJENCgo7GKooe4rsIx-t_wIWl7ngr03F2k,1131
|
11
|
-
depsdev-0.0.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|