pybiolib 1.1.1440__py3-none-any.whl → 1.1.1445__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.
- biolib/api/client.py +3 -3
- biolib/biolib_api_client/auth.py +4 -17
- {pybiolib-1.1.1440.dist-info → pybiolib-1.1.1445.dist-info}/METADATA +1 -1
- {pybiolib-1.1.1440.dist-info → pybiolib-1.1.1445.dist-info}/RECORD +7 -7
- {pybiolib-1.1.1440.dist-info → pybiolib-1.1.1445.dist-info}/LICENSE +0 -0
- {pybiolib-1.1.1440.dist-info → pybiolib-1.1.1445.dist-info}/WHEEL +0 -0
- {pybiolib-1.1.1440.dist-info → pybiolib-1.1.1445.dist-info}/entry_points.txt +0 -0
biolib/api/client.py
CHANGED
@@ -56,7 +56,6 @@ class ApiClient:
|
|
56
56
|
) -> BioLibHTTPResponse:
|
57
57
|
url = self._get_absolute_url(path, query_params=params)
|
58
58
|
req = urllib.request.Request(url, headers=self._get_headers(headers, authenticate))
|
59
|
-
|
60
59
|
retries = 10
|
61
60
|
for retry_count in range(retries):
|
62
61
|
if retry_count > 0:
|
@@ -74,12 +73,13 @@ class ApiClient:
|
|
74
73
|
|
75
74
|
except urllib.error.URLError as error:
|
76
75
|
if isinstance(error.reason, socket.timeout):
|
77
|
-
logger_no_user_data.debug(f'HTTP
|
76
|
+
logger_no_user_data.debug(f'HTTP GET request failed with read timeout for "{path}"')
|
78
77
|
continue
|
79
78
|
|
80
79
|
raise Exception(f'HTTP GET request failed after {retries} retries for "{url}"')
|
81
80
|
|
82
|
-
def post(self, path: str, data: Union[Dict, bytes]
|
81
|
+
def post(self, path: str, data: Optional[Union[Dict, bytes]] = None,
|
82
|
+
headers: OptionalHeaders = None) -> BioLibHTTPResponse:
|
83
83
|
retries = 3
|
84
84
|
for retry_count in range(retries):
|
85
85
|
if retry_count > 0:
|
biolib/biolib_api_client/auth.py
CHANGED
@@ -1,9 +1,7 @@
|
|
1
|
-
import requests
|
2
1
|
from requests.auth import AuthBase # type: ignore
|
3
2
|
|
4
|
-
from biolib
|
3
|
+
from biolib import api
|
5
4
|
from biolib.biolib_api_client.api_client import UserTokens
|
6
|
-
from biolib.biolib_errors import BioLibError
|
7
5
|
from biolib.typing_utils import TypedDict, Literal
|
8
6
|
|
9
7
|
|
@@ -33,27 +31,16 @@ class BiolibAuthChallengeApi:
|
|
33
31
|
|
34
32
|
@staticmethod
|
35
33
|
def create_auth_challenge() -> AuthChallengeCreate:
|
36
|
-
response =
|
37
|
-
url=f'{BiolibApiClient.get().base_url}/api/user/auth_challenges/',
|
38
|
-
timeout=5,
|
39
|
-
)
|
40
|
-
|
41
|
-
if not response.ok:
|
42
|
-
raise BioLibError(response.content.decode())
|
43
|
-
|
34
|
+
response = api._client.post(path='/user/auth_challenges/') # pylint: disable=protected-access
|
44
35
|
response_dict: AuthChallengeCreate = response.json()
|
45
36
|
return response_dict
|
46
37
|
|
47
38
|
@staticmethod
|
48
39
|
def get_auth_challenge_status(token: str) -> AuthChallengeStatus:
|
49
|
-
response =
|
50
|
-
|
40
|
+
response = api._client.get( # pylint: disable=protected-access
|
41
|
+
path='/user/auth_challenges/',
|
51
42
|
headers={'Auth-Challenge-Token': token},
|
52
|
-
timeout=5,
|
53
43
|
)
|
54
44
|
|
55
|
-
if not response.ok:
|
56
|
-
raise BioLibError(response.content.decode())
|
57
|
-
|
58
45
|
response_dict: AuthChallengeStatus = response.json()
|
59
46
|
return response_dict
|
@@ -2,14 +2,14 @@ LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
|
|
2
2
|
README.md,sha256=_IH7pxFiqy2bIAmaVeA-iVTyUwWRjMIlfgtUbYTtmls,368
|
3
3
|
biolib/__init__.py,sha256=yoQA2fWt8aToFas3sx6UIoFBW7-dd2yf7Nyi5smQl88,3418
|
4
4
|
biolib/api/__init__.py,sha256=fhsbqVxDYfQ2NMYKkFW-msplAa1YPllfKEkAtLdD9IM,95
|
5
|
-
biolib/api/client.py,sha256=
|
5
|
+
biolib/api/client.py,sha256=9z__FvXvwqYgjvesHyZxD8QGD3veAnaEYOZ1WKWsLvo,6279
|
6
6
|
biolib/app/__init__.py,sha256=cdPtcfb_U-bxb9iSL4fCEq2rpD9OjkyY4W-Zw60B0LI,37
|
7
7
|
biolib/app/app.py,sha256=6V_36uqwiC5ERtv2wU7J3KxbV9dKxMlKugx15ylSsTY,10186
|
8
8
|
biolib/app/search_apps.py,sha256=CIanvDebNpMtWck0w4IoR_tRZ6LpSWC8DPxXW2e6Ww4,1495
|
9
9
|
biolib/biolib_api_client/__init__.py,sha256=E5EMa19wJoblwSdQPYrxc_BtIeRsAuO0L_jQweWw-Yk,182
|
10
10
|
biolib/biolib_api_client/api_client.py,sha256=4H1lFXWTm-MGmgP8wEHWWzLH_YGnCVx1aQJX0H2PFDg,7092
|
11
11
|
biolib/biolib_api_client/app_types.py,sha256=vEjkpMwaMfz8MxBBZQfWCkxqT7NXxWocB_Oe9WHjJ_g,2425
|
12
|
-
biolib/biolib_api_client/auth.py,sha256=
|
12
|
+
biolib/biolib_api_client/auth.py,sha256=eR1DhaijmiL7pKKxNGsHL4g5AZwBqgMrJLpUzoskLDU,1341
|
13
13
|
biolib/biolib_api_client/biolib_account_api.py,sha256=2Mc6SbmjBSsz8lF2H3iiaZHEm47LyI0B4rjmvzxKHt4,580
|
14
14
|
biolib/biolib_api_client/biolib_app_api.py,sha256=qYUSTyVxCCidNCX7xIQlaQ6vyGLkx1O7PXSxPltlUgA,3793
|
15
15
|
biolib/biolib_api_client/biolib_job_api.py,sha256=EBtKdfe8wrU5ZoiZ8KxtBKCwxq4gAuU6zwxN8r4NikA,7860
|
@@ -96,8 +96,8 @@ biolib/utils/cache_state.py,sha256=BFrZlV4XZIueIFzAFiPidX4hmwADKY5Y5ZuqlerF5l0,3
|
|
96
96
|
biolib/utils/multipart_uploader.py,sha256=Bf09MJcIOBwzG8L1i5UeQ2cNcYohxklhhWWAMpnE41I,9671
|
97
97
|
biolib/utils/seq_util.py,sha256=QRLYIPg1yM_LF9bFuM-Ow14gTHoG3rOK6CeGHD705qw,2612
|
98
98
|
biolib/utils/zip/remote_zip.py,sha256=NCdUnVbGCv7SfXCI-yVU-is_OnyWmLAnVpIdSvo-W4k,23500
|
99
|
-
pybiolib-1.1.
|
100
|
-
pybiolib-1.1.
|
101
|
-
pybiolib-1.1.
|
102
|
-
pybiolib-1.1.
|
103
|
-
pybiolib-1.1.
|
99
|
+
pybiolib-1.1.1445.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
|
100
|
+
pybiolib-1.1.1445.dist-info/METADATA,sha256=DRlu0hb5CL798tkSRbozD7W_lKGNr-iRJICvkTBR5s0,1492
|
101
|
+
pybiolib-1.1.1445.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
|
102
|
+
pybiolib-1.1.1445.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
|
103
|
+
pybiolib-1.1.1445.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|