Skip to content

Commit f4ec43d

Browse files
authored
feat(DEVC-2097): upgrade urllib3 & redis + fix MAX_RETRY_COUNT [SDK VERSION 2.0] (#120)
* feat(DEVC-2097): upgrade urllib3 + fix `MAX_RETRY_COUNT` * feat(DEVC-2097): upgrade redis dependency * feat(DEVC-2097): bump min runtime version on CI side
1 parent dc8df8a commit f4ec43d

7 files changed

Lines changed: 59 additions & 18 deletions

File tree

.github/workflows/main.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: CI
33
on: push
44

55
env:
6-
PYTHON_VERSIONS: '[ "3.9", "3.10", "3.11", "3.12", "3.13.3" ]'
6+
PYTHON_VERSIONS: '[ "3.10", "3.11", "3.12", "3.13.3" ]'
77

88
jobs:
99

@@ -25,10 +25,10 @@ jobs:
2525
python-version: ${{ fromJSON(needs.set-python-matrix.outputs.python_versions) }}
2626

2727
steps:
28-
- uses: actions/checkout@v2
28+
- uses: actions/checkout@v6
2929

3030
- name: Set up Python ${{ matrix.python-version }}
31-
uses: actions/setup-python@v2
31+
uses: actions/setup-python@v6
3232
with:
3333
python-version: ${{ matrix.python-version }}
3434

@@ -48,10 +48,10 @@ jobs:
4848
python-version: ${{ fromJSON(needs.set-python-matrix.outputs.python_versions) }}
4949

5050
steps:
51-
- uses: actions/checkout@v2
51+
- uses: actions/checkout@v6
5252

5353
- name: Set up Python ${{ matrix.python-version }}
54-
uses: actions/setup-python@v2
54+
uses: actions/setup-python@v6
5555
with:
5656
python-version: ${{ matrix.python-version }}
5757

@@ -103,11 +103,11 @@ jobs:
103103
runs-on: ubuntu-latest
104104

105105
steps:
106-
- uses: actions/checkout@v2
106+
- uses: actions/checkout@v6
107107

108-
- uses: actions/setup-python@v2
108+
- uses: actions/setup-python@v6
109109
with:
110-
python-version: 3.9
110+
python-version: '3.10'
111111

112112
- name: Install dependencies
113113
run: pip install -U setuptools wheel build
@@ -131,7 +131,7 @@ jobs:
131131
runs-on: ubuntu-latest
132132

133133
steps:
134-
- uses: actions/checkout@v2
134+
- uses: actions/checkout@v6
135135

136136
- name: Build
137137
run: make docs

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [2.1.0] - 2026-01-15
10+
### Dependency
11+
- Upgraded internal dependency `redis` to version `redis >=7.1.0, <8.0.0`
12+
- Bumped a supported SDK runtime version to minimum `3.10` since new redis lib drops support for `3.9`
13+
14+
15+
## [2.0.4] - 2026-01-14
16+
### Security
17+
- Upgraded internal dependency `urllib3` to version `urllib3 >= 2.6.3, <3.0.0` since `2.5.0` has [these](https://security.snyk.io/package/pip/urllib3/2.5.0) vulnerabilities
18+
### Fixed
19+
- Fixed issue with `MAX_RETRY_COUNT`
20+
21+
922
## [2.0.3] - 2025-12-08
1023
### Fixed
1124
- Fix some deprecation warnings raised by Pydantic V2

docs/antora-playbook.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ content:
77
start_path: docs
88
branches: []
99
# branches: HEAD # Use this for local development
10-
tags: [v2.0.3]
10+
tags: [v2.1.0]
1111
asciidoc:
1212
attributes:
1313
page-toclevels: 5

docs/antora.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
name: corva-sdk
2-
version: ~
2+
version: 2.1.0
33
nav: [modules/ROOT/nav.adoc]

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ build-backend = "setuptools.build_meta"
66
name = "corva-sdk"
77
description = "SDK for building Corva DevCenter Python apps."
88
readme = "README.md"
9-
version = "2.0.3"
9+
version = "2.1.0"
1010
license = { text = "The Unlicense" }
1111
authors = [
1212
{ name = "Jordan Ambra", email = "jordan.ambra@corva.ai" }
1313
]
1414
keywords = ["corva", "sdk"]
15-
requires-python = ">=3.9,<4.0"
15+
requires-python = ">=3.10,<4.0"
1616
dependencies = [
1717
"fakeredis >= 2.30.0, <2.32.0",
1818
"pydantic >= 2.0, <3.0",
1919
"pydantic-settings >= 2.0, <3.0",
20-
"redis == 6.4.0",
20+
"redis >=7.1.0, <8.0.0",
2121
"requests >= 2.32.3, <3.0.0",
22-
"urllib3 == 2.5.0",
22+
"urllib3 >= 2.6.3, <3.0.0",
2323
"semver == 3.0.4"
2424
]
2525
classifiers = [

src/corva/configuration.py

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,44 @@
11
import datetime
2+
import logging
23

34
import pydantic_settings
45
from pydantic import AnyHttpUrl, BeforeValidator, TypeAdapter
56
from typing_extensions import Annotated
67

8+
logger = logging.getLogger("corva")
9+
710

811
def validate_http_url_to_str(v: str) -> str:
912
TypeAdapter(AnyHttpUrl).validate_python(v)
1013
return v
1114

1215

16+
def _parse_max_retry_count(value) -> int:
17+
18+
if value is None or value == "":
19+
return DEFAULT_MAX_RETRY_COUNT
20+
try:
21+
if isinstance(value, bool):
22+
raise TypeError
23+
if isinstance(value, int):
24+
return value
25+
if isinstance(value, str):
26+
return int(value.strip())
27+
except (TypeError, ValueError):
28+
pass
29+
30+
logger.warning(
31+
"Invalid MAX_RETRY_COUNT value %r; using default %d.",
32+
value,
33+
DEFAULT_MAX_RETRY_COUNT,
34+
)
35+
return DEFAULT_MAX_RETRY_COUNT
36+
37+
1338
HttpUrlStr = Annotated[str, BeforeValidator(validate_http_url_to_str)]
39+
MaxRetryValidator = Annotated[int, BeforeValidator(lambda v: _parse_max_retry_count(v))]
40+
41+
DEFAULT_MAX_RETRY_COUNT = 3
1442

1543

1644
class Settings(pydantic_settings.BaseSettings):
@@ -39,8 +67,8 @@ class Settings(pydantic_settings.BaseSettings):
3967
POOL_MAX_SIZE: int = 20 # Max connections count per pool/host
4068
POOL_BLOCK: bool = True # Wait until connection released
4169

42-
# retry
43-
MAX_RETRY_COUNT: int = 3 # If `0` then retries will be disabled
70+
# retry. If `0` then retries will be disabled
71+
MAX_RETRY_COUNT: MaxRetryValidator = DEFAULT_MAX_RETRY_COUNT
4472
BACKOFF_FACTOR: float = 1.0
4573

4674
# OTEL

src/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = "2.0.3"
1+
VERSION = "2.1.0"

0 commit comments

Comments
 (0)