wherobots-python-dbapi 0.23.0__tar.gz → 0.23.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.
Files changed (17) hide show
  1. {wherobots_python_dbapi-0.23.0 → wherobots_python_dbapi-0.23.2}/PKG-INFO +2 -2
  2. {wherobots_python_dbapi-0.23.0 → wherobots_python_dbapi-0.23.2}/pyproject.toml +2 -2
  3. {wherobots_python_dbapi-0.23.0 → wherobots_python_dbapi-0.23.2}/wherobots/db/driver.py +13 -2
  4. {wherobots_python_dbapi-0.23.0 → wherobots_python_dbapi-0.23.2}/wherobots/db/runtime.py +9 -2
  5. {wherobots_python_dbapi-0.23.0 → wherobots_python_dbapi-0.23.2}/.gitignore +0 -0
  6. {wherobots_python_dbapi-0.23.0 → wherobots_python_dbapi-0.23.2}/LICENSE +0 -0
  7. {wherobots_python_dbapi-0.23.0 → wherobots_python_dbapi-0.23.2}/README.md +0 -0
  8. {wherobots_python_dbapi-0.23.0 → wherobots_python_dbapi-0.23.2}/wherobots/__init__.py +0 -0
  9. {wherobots_python_dbapi-0.23.0 → wherobots_python_dbapi-0.23.2}/wherobots/db/__init__.py +0 -0
  10. {wherobots_python_dbapi-0.23.0 → wherobots_python_dbapi-0.23.2}/wherobots/db/connection.py +0 -0
  11. {wherobots_python_dbapi-0.23.0 → wherobots_python_dbapi-0.23.2}/wherobots/db/constants.py +0 -0
  12. {wherobots_python_dbapi-0.23.0 → wherobots_python_dbapi-0.23.2}/wherobots/db/cursor.py +0 -0
  13. {wherobots_python_dbapi-0.23.0 → wherobots_python_dbapi-0.23.2}/wherobots/db/errors.py +0 -0
  14. {wherobots_python_dbapi-0.23.0 → wherobots_python_dbapi-0.23.2}/wherobots/db/models.py +0 -0
  15. {wherobots_python_dbapi-0.23.0 → wherobots_python_dbapi-0.23.2}/wherobots/db/region.py +0 -0
  16. {wherobots_python_dbapi-0.23.0 → wherobots_python_dbapi-0.23.2}/wherobots/db/session_type.py +0 -0
  17. {wherobots_python_dbapi-0.23.0 → wherobots_python_dbapi-0.23.2}/wherobots/db/types.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wherobots-python-dbapi
3
- Version: 0.23.0
3
+ Version: 0.23.2
4
4
  Summary: Python DB-API driver for Wherobots DB
5
5
  Project-URL: Homepage, https://github.com/wherobots/wherobots-python-dbapi-driver
6
6
  Project-URL: Tracker, https://github.com/wherobots/wherobots-python-dbapi-driver/issues
@@ -13,7 +13,7 @@ Requires-Dist: packaging
13
13
  Requires-Dist: pandas
14
14
  Requires-Dist: pandas-stubs>=2.0.3.230814
15
15
  Requires-Dist: pyarrow>=14.0.2
16
- Requires-Dist: requests>=2.31.0
16
+ Requires-Dist: requests>=2.32.5
17
17
  Requires-Dist: strenum<0.5,>=0.4.15
18
18
  Requires-Dist: tenacity>=8.2.3
19
19
  Requires-Dist: types-requests>=2.32.0.20241016
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "wherobots-python-dbapi"
3
- version = "0.23.0"
3
+ version = "0.23.2"
4
4
  description = "Python DB-API driver for Wherobots DB"
5
5
  authors = [{ name = "Maxime Petazzoni", email = "max@wherobots.com" }]
6
6
  requires-python = ">=3.10, <4"
@@ -8,7 +8,7 @@ readme = "README.md"
8
8
  license = "Apache-2.0"
9
9
  dependencies = [
10
10
  "packaging",
11
- "requests>=2.31.0",
11
+ "requests>=2.32.5",
12
12
  "websockets>=13.0",
13
13
  "tenacity>=8.2.3",
14
14
  "cbor2>=5.6.3",
@@ -46,6 +46,10 @@ apilevel = "2.0"
46
46
  threadsafety = 1
47
47
  paramstyle: Final[str] = PARAM_STYLE
48
48
 
49
+ # HTTP status codes that indicate transient server-side issues and should be retried.
50
+ # This follows the industry-standard set used by urllib3.util.Retry's status_forcelist.
51
+ TRANSIENT_HTTP_STATUS_CODES = {429, 502, 503, 504}
52
+
49
53
 
50
54
  def gen_user_agent_header():
51
55
  try:
@@ -135,9 +139,16 @@ def connect(
135
139
  @tenacity.retry(
136
140
  stop=tenacity.stop_after_delay(wait_timeout),
137
141
  wait=tenacity.wait_exponential(multiplier=1, min=1, max=5),
138
- retry=tenacity.retry_if_not_exception_type(
139
- (requests.HTTPError, OperationalError)
142
+ retry=(
143
+ tenacity.retry_if_exception(
144
+ lambda e: (
145
+ isinstance(e, requests.HTTPError)
146
+ and e.response.status_code in TRANSIENT_HTTP_STATUS_CODES
147
+ )
148
+ )
149
+ | tenacity.retry_if_exception_type(tenacity.TryAgain)
140
150
  ),
151
+ reraise=True,
141
152
  )
142
153
  def get_session_uri() -> str:
143
154
  r = requests.get(session_id_url, headers=headers)
@@ -2,6 +2,7 @@ from enum import Enum
2
2
 
3
3
 
4
4
  class Runtime(Enum):
5
+ # CPU/General purpose runtimes
5
6
  MICRO = "micro"
6
7
  TINY = "tiny"
7
8
  SMALL = "small"
@@ -11,18 +12,24 @@ class Runtime(Enum):
11
12
  XX_LARGE = "2x-large"
12
13
  XXXX_LARGE = "4x-large"
13
14
 
14
- # HIMEM
15
+ # HIMEM/Memory-optimized runtimes
15
16
  MEDIUM_HIMEM = "medium-himem"
16
17
  LARGE_HIMEM = "large-himem"
17
18
  X_LARGE_HIMEM = "x-large-himem"
18
19
  XX_LARGE_HIMEM = "2x-large-himem"
19
20
  XXXX_LARGE_HIMEM = "4x-large-himem"
20
21
 
21
- # GPU
22
+ # HICPU/Compute-optimized runtimes
23
+ X_LARGE_HICPU = "x-large-hicpu"
24
+ XX_LARGE_HICPU = "2x-large-hicpu"
25
+
26
+ # GPU-accelerated runtimes
22
27
  MICRO_A10_GPU = "micro-a10-gpu"
23
28
  TINY_A10_GPU = "tiny-a10-gpu"
24
29
  SMALL_A10_GPU = "small-a10-gpu"
25
30
  MEDIUM_A10_GPU = "medium-a10-gpu"
31
+ LARGE_A10_GPU = "large-a10-gpu"
32
+ X_LARGE_A10_GPU = "x-large-a10-gpu"
26
33
 
27
34
 
28
35
  _NAME_TO_ENUM = {runtime.value: runtime for runtime in Runtime}