gen3authz 2.3.0__tar.gz → 2.3.2__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.
@@ -1,8 +1,10 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: gen3authz
3
- Version: 2.3.0
3
+ Version: 2.3.2
4
4
  Summary: Gen3 authz client
5
5
  License: Apache-2.0
6
+ License-File: LICENSE
7
+ License-File: NOTICE
6
8
  Author: CTDS UChicago
7
9
  Author-email: cdis@uchicago.edu
8
10
  Requires-Python: >=3.6,<4.0
@@ -16,6 +18,7 @@ Classifier: Programming Language :: Python :: 3.10
16
18
  Classifier: Programming Language :: Python :: 3.11
17
19
  Classifier: Programming Language :: Python :: 3.12
18
20
  Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: 3.14
19
22
  Requires-Dist: backoff (>=1.6,<2.0)
20
23
  Requires-Dist: cdiserrors (<2.0.0)
21
24
  Requires-Dist: contextvars (>=2.4,<3.0) ; python_version < "3.7"
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "gen3authz"
3
- version = "2.3.0"
3
+ version = "2.3.2"
4
4
  description = "Gen3 authz client"
5
5
  authors = ["CTDS UChicago <cdis@uchicago.edu>"]
6
6
  license = "Apache-2.0"
@@ -15,6 +15,7 @@ import backoff
15
15
  import contextvars
16
16
  import httpx
17
17
  from cdislogging import get_logger
18
+ from gen3authz.client.arborist.errors import ArboristTimeoutError
18
19
 
19
20
  from ..arborist.errors import ArboristError, ArboristUnhealthyError
20
21
  from ..base import AuthzClient
@@ -201,7 +202,7 @@ class BaseArboristClient(AuthzClient):
201
202
  async with self.client_cls() as client:
202
203
  try:
203
204
  rv = await client.request(method, url, **kwargs)
204
- except httpx.TimeoutException:
205
+ except httpx.TimeoutException as e:
205
206
  if retry:
206
207
  if isinstance(retry, bool):
207
208
  retry = {}
@@ -224,9 +225,14 @@ class BaseArboristClient(AuthzClient):
224
225
  )()
225
226
  if inspect.isawaitable(res):
226
227
  res = await res
227
- rv = await client.request(method, url, **kwargs)
228
+ try:
229
+ rv = await client.request(method, url, **kwargs)
230
+ except httpx.TimeoutException as e:
231
+ raise ArboristTimeoutError(
232
+ "Request to arborist timed out"
233
+ ) from e
228
234
  else:
229
- raise
235
+ raise ArboristTimeoutError("Request to arborist timed out") from e
230
236
  return ArboristResponse(rv, expect_json=expect_json)
231
237
 
232
238
  def get(self, url, params=None, **kwargs):
@@ -18,3 +18,7 @@ class ArboristUnhealthyError(InternalError, ArboristError):
18
18
  self.message = message or "could not reach arborist service"
19
19
  self.code = 500
20
20
  self.json = {"error": self.message, "code": self.code}
21
+
22
+
23
+ class ArboristTimeoutError(Exception):
24
+ pass
File without changes
File without changes