comb-utils 0.5.2__tar.gz → 0.6.3__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.
- {comb_utils-0.5.2/src/comb_utils.egg-info → comb_utils-0.6.3}/PKG-INFO +13 -4
- {comb_utils-0.5.2 → comb_utils-0.6.3}/README.md +8 -0
- {comb_utils-0.5.2 → comb_utils-0.6.3}/setup.cfg +8 -4
- {comb_utils-0.5.2 → comb_utils-0.6.3}/src/comb_utils/lib/api_callers.py +11 -9
- comb_utils-0.6.3/src/comb_utils/py.typed +0 -0
- {comb_utils-0.5.2 → comb_utils-0.6.3/src/comb_utils.egg-info}/PKG-INFO +13 -4
- {comb_utils-0.5.2 → comb_utils-0.6.3}/src/comb_utils.egg-info/SOURCES.txt +1 -0
- {comb_utils-0.5.2 → comb_utils-0.6.3}/src/comb_utils.egg-info/requires.txt +4 -3
- {comb_utils-0.5.2 → comb_utils-0.6.3}/LICENSE +0 -0
- {comb_utils-0.5.2 → comb_utils-0.6.3}/pyproject.toml +0 -0
- {comb_utils-0.5.2 → comb_utils-0.6.3}/src/comb_utils/__init__.py +0 -0
- {comb_utils-0.5.2 → comb_utils-0.6.3}/src/comb_utils/lib/__init__.py +0 -0
- {comb_utils-0.5.2 → comb_utils-0.6.3}/src/comb_utils/lib/constants.py +0 -0
- {comb_utils-0.5.2 → comb_utils-0.6.3}/src/comb_utils/lib/docs.py +0 -0
- {comb_utils-0.5.2 → comb_utils-0.6.3}/src/comb_utils/lib/errors.py +0 -0
- {comb_utils-0.5.2 → comb_utils-0.6.3}/src/comb_utils.egg-info/dependency_links.txt +0 -0
- {comb_utils-0.5.2 → comb_utils-0.6.3}/src/comb_utils.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: comb_utils
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.3
|
|
4
4
|
Summary: Handy utils for Python projects.
|
|
5
5
|
Author: Kaleb Coberly
|
|
6
6
|
Maintainer-email: kaleb.coberly@gmail.com
|
|
@@ -25,6 +25,7 @@ Requires-Dist: sphinx-autodoc-typehints; extra == "doc"
|
|
|
25
25
|
Provides-Extra: qc
|
|
26
26
|
Requires-Dist: bandit; extra == "qc"
|
|
27
27
|
Requires-Dist: black; extra == "qc"
|
|
28
|
+
Requires-Dist: comb_utils[test]; extra == "qc"
|
|
28
29
|
Requires-Dist: flake8; extra == "qc"
|
|
29
30
|
Requires-Dist: flake8-annotations; extra == "qc"
|
|
30
31
|
Requires-Dist: flake8-bandit; extra == "qc"
|
|
@@ -33,10 +34,10 @@ Requires-Dist: flake8-bugbear; extra == "qc"
|
|
|
33
34
|
Requires-Dist: flake8-docstrings; extra == "qc"
|
|
34
35
|
Requires-Dist: flake8-isort; extra == "qc"
|
|
35
36
|
Requires-Dist: isort; extra == "qc"
|
|
36
|
-
Requires-Dist:
|
|
37
|
-
Requires-Dist:
|
|
38
|
-
Requires-Dist: comb_utils[test]; extra == "qc"
|
|
37
|
+
Requires-Dist: mypy; extra == "qc"
|
|
38
|
+
Requires-Dist: pip-audit; extra == "qc"
|
|
39
39
|
Requires-Dist: safety; extra == "qc"
|
|
40
|
+
Requires-Dist: types-requests; extra == "qc"
|
|
40
41
|
Provides-Extra: test
|
|
41
42
|
Requires-Dist: coverage[toml]; extra == "test"
|
|
42
43
|
Requires-Dist: pytest; extra == "test"
|
|
@@ -136,6 +137,14 @@ When making smaller commits, you might just want to run some of the smaller comm
|
|
|
136
137
|
$ make clean format full-qc full-test
|
|
137
138
|
```
|
|
138
139
|
|
|
140
|
+
#### Type checking
|
|
141
|
+
|
|
142
|
+
This project uses [mypy](https://mypy-lang.org) for type checking. Run it with:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
$ make typecheck
|
|
146
|
+
```
|
|
147
|
+
|
|
139
148
|
#### Using act
|
|
140
149
|
|
|
141
150
|
As a final step, it's good practice to test run the workflow before opening a PR or pushing to an open PR. We don't want to waste GitHub runtime on a glitch that we could have caught before. You can use a make target for that:
|
|
@@ -91,6 +91,14 @@ When making smaller commits, you might just want to run some of the smaller comm
|
|
|
91
91
|
$ make clean format full-qc full-test
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
+
#### Type checking
|
|
95
|
+
|
|
96
|
+
This project uses [mypy](https://mypy-lang.org) for type checking. Run it with:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
$ make typecheck
|
|
100
|
+
```
|
|
101
|
+
|
|
94
102
|
#### Using act
|
|
95
103
|
|
|
96
104
|
As a final step, it's good practice to test run the workflow before opening a PR or pushing to an open PR. We don't want to waste GitHub runtime on a glitch that we could have caught before. You can use a make target for that:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[metadata]
|
|
2
2
|
name = comb_utils
|
|
3
|
-
version = 0.
|
|
3
|
+
version = 0.6.3
|
|
4
4
|
description = Handy utils for Python projects.
|
|
5
5
|
long_description = file: README.md
|
|
6
6
|
long_description_content_type = text/markdown
|
|
@@ -20,6 +20,9 @@ install_requires =
|
|
|
20
20
|
[options.packages.find]
|
|
21
21
|
where = src
|
|
22
22
|
|
|
23
|
+
[options.package_data]
|
|
24
|
+
comb_utils = py.typed
|
|
25
|
+
|
|
23
26
|
[options.extras_require]
|
|
24
27
|
dev =
|
|
25
28
|
comb_utils[build]
|
|
@@ -37,6 +40,7 @@ doc =
|
|
|
37
40
|
qc =
|
|
38
41
|
bandit
|
|
39
42
|
black
|
|
43
|
+
comb_utils[test]
|
|
40
44
|
flake8
|
|
41
45
|
flake8-annotations
|
|
42
46
|
flake8-bandit
|
|
@@ -45,10 +49,10 @@ qc =
|
|
|
45
49
|
flake8-docstrings
|
|
46
50
|
flake8-isort
|
|
47
51
|
isort
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
comb_utils[test]
|
|
52
|
+
mypy
|
|
53
|
+
pip-audit
|
|
51
54
|
safety
|
|
55
|
+
types-requests
|
|
52
56
|
test =
|
|
53
57
|
coverage[toml]
|
|
54
58
|
pytest
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"""Classes for making API calls."""
|
|
2
2
|
|
|
3
3
|
import logging
|
|
4
|
-
from abc import abstractmethod
|
|
5
|
-
from collections.abc import Callable
|
|
4
|
+
from abc import ABC, abstractmethod
|
|
5
|
+
from collections.abc import Callable as _Callable
|
|
6
6
|
from time import sleep
|
|
7
7
|
from typing import Any
|
|
8
8
|
from urllib.parse import parse_qs, urlencode, urlparse, urlunparse
|
|
@@ -23,7 +23,7 @@ logger = logging.getLogger(__name__)
|
|
|
23
23
|
# Why are we using _set_request_call instead of the _request_call property?
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
class BaseCaller:
|
|
26
|
+
class BaseCaller(ABC):
|
|
27
27
|
"""An abstract class for making API calls.
|
|
28
28
|
|
|
29
29
|
See :doc:`api_callers`.
|
|
@@ -82,7 +82,7 @@ class BaseCaller:
|
|
|
82
82
|
|
|
83
83
|
# Must set in child class with _set*:
|
|
84
84
|
#: The requests call method. (get, post, etc.)
|
|
85
|
-
_request_call:
|
|
85
|
+
_request_call: _Callable[..., requests.Response]
|
|
86
86
|
#: The URL for the API call.
|
|
87
87
|
_url: str
|
|
88
88
|
|
|
@@ -208,12 +208,12 @@ class BaseCaller:
|
|
|
208
208
|
)
|
|
209
209
|
|
|
210
210
|
@typechecked
|
|
211
|
-
def _get_API_key(self) -> str
|
|
211
|
+
def _get_API_key(self) -> str:
|
|
212
212
|
"""Get the API key.
|
|
213
213
|
|
|
214
214
|
Defaults to None, but can be overridden in child class.
|
|
215
215
|
"""
|
|
216
|
-
return
|
|
216
|
+
return ""
|
|
217
217
|
|
|
218
218
|
@typechecked
|
|
219
219
|
def _handle_429(self) -> None:
|
|
@@ -394,8 +394,10 @@ class BasePagedResponseGetter(BaseGetCaller):
|
|
|
394
394
|
f"Duplicate entries found in query string: {duplicate_entries}"
|
|
395
395
|
)
|
|
396
396
|
|
|
397
|
-
|
|
398
|
-
|
|
397
|
+
query_params_flat: dict[str, str] = {
|
|
398
|
+
key: val[0] for key, val in query_params.items()
|
|
399
|
+
}
|
|
400
|
+
updated_query = urlencode(query_params_flat)
|
|
399
401
|
self._page_url = urlunparse(parsed_url._replace(query=updated_query))
|
|
400
402
|
|
|
401
403
|
@typechecked
|
|
@@ -455,7 +457,7 @@ def get_responses(
|
|
|
455
457
|
A list of dictionaries containing the responses from all pages.
|
|
456
458
|
"""
|
|
457
459
|
# Calling the token salsa to trick bandit into ignoring what looks like a hardcoded token.
|
|
458
|
-
next_page_salsa = ""
|
|
460
|
+
next_page_salsa: str | None = ""
|
|
459
461
|
next_page_cookie = ""
|
|
460
462
|
responses = []
|
|
461
463
|
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: comb_utils
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.3
|
|
4
4
|
Summary: Handy utils for Python projects.
|
|
5
5
|
Author: Kaleb Coberly
|
|
6
6
|
Maintainer-email: kaleb.coberly@gmail.com
|
|
@@ -25,6 +25,7 @@ Requires-Dist: sphinx-autodoc-typehints; extra == "doc"
|
|
|
25
25
|
Provides-Extra: qc
|
|
26
26
|
Requires-Dist: bandit; extra == "qc"
|
|
27
27
|
Requires-Dist: black; extra == "qc"
|
|
28
|
+
Requires-Dist: comb_utils[test]; extra == "qc"
|
|
28
29
|
Requires-Dist: flake8; extra == "qc"
|
|
29
30
|
Requires-Dist: flake8-annotations; extra == "qc"
|
|
30
31
|
Requires-Dist: flake8-bandit; extra == "qc"
|
|
@@ -33,10 +34,10 @@ Requires-Dist: flake8-bugbear; extra == "qc"
|
|
|
33
34
|
Requires-Dist: flake8-docstrings; extra == "qc"
|
|
34
35
|
Requires-Dist: flake8-isort; extra == "qc"
|
|
35
36
|
Requires-Dist: isort; extra == "qc"
|
|
36
|
-
Requires-Dist:
|
|
37
|
-
Requires-Dist:
|
|
38
|
-
Requires-Dist: comb_utils[test]; extra == "qc"
|
|
37
|
+
Requires-Dist: mypy; extra == "qc"
|
|
38
|
+
Requires-Dist: pip-audit; extra == "qc"
|
|
39
39
|
Requires-Dist: safety; extra == "qc"
|
|
40
|
+
Requires-Dist: types-requests; extra == "qc"
|
|
40
41
|
Provides-Extra: test
|
|
41
42
|
Requires-Dist: coverage[toml]; extra == "test"
|
|
42
43
|
Requires-Dist: pytest; extra == "test"
|
|
@@ -136,6 +137,14 @@ When making smaller commits, you might just want to run some of the smaller comm
|
|
|
136
137
|
$ make clean format full-qc full-test
|
|
137
138
|
```
|
|
138
139
|
|
|
140
|
+
#### Type checking
|
|
141
|
+
|
|
142
|
+
This project uses [mypy](https://mypy-lang.org) for type checking. Run it with:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
$ make typecheck
|
|
146
|
+
```
|
|
147
|
+
|
|
139
148
|
#### Using act
|
|
140
149
|
|
|
141
150
|
As a final step, it's good practice to test run the workflow before opening a PR or pushing to an open PR. We don't want to waste GitHub runtime on a glitch that we could have caught before. You can use a make target for that:
|
|
@@ -20,6 +20,7 @@ sphinx-autodoc-typehints
|
|
|
20
20
|
[qc]
|
|
21
21
|
bandit
|
|
22
22
|
black
|
|
23
|
+
comb_utils[test]
|
|
23
24
|
flake8
|
|
24
25
|
flake8-annotations
|
|
25
26
|
flake8-bandit
|
|
@@ -28,10 +29,10 @@ flake8-bugbear
|
|
|
28
29
|
flake8-docstrings
|
|
29
30
|
flake8-isort
|
|
30
31
|
isort
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
comb_utils[test]
|
|
32
|
+
mypy
|
|
33
|
+
pip-audit
|
|
34
34
|
safety
|
|
35
|
+
types-requests
|
|
35
36
|
|
|
36
37
|
[test]
|
|
37
38
|
coverage[toml]
|
|
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
|