Skip to content

Commit cc99d40

Browse files
authored
feat: support Python 3.15 (#757)
Lift the Requires-Python cap to <3.16 and add 3.15 to the classifiers, black target versions and the test and lint CI matrices. - Floor beartype at 0.23.1 in the mcp extra. Earlier releases import typing.no_type_check_decorator, which 3.15 removed, so fastmcp failed to import and the MCP server fell back to its stub. - Relock: rpds-py 2026.9.1 (0.30.0 cannot build on 3.15) and beartype 0.23.1. The re-split forks also move 3.14 onto google-cloud-aiplatform 1.154.0, grpcio 1.84.0 and protobuf 6.33.6. - Bump uv to 0.13.1, the first line that ships CPython 3.15.0 final. - torch has no cp315 wheels on PyPI yet, so the 3.15 legs install every extra except sentence-transformers and all. Tests marked requires_hf now skip when sentence-transformers is not installed, and the HF tests that lacked the marker carry it. - Loosen the ** TypeError assertion; 3.15 reworded the message. - Ignore pytest-asyncio 0.23's asyncio deprecation warnings. On 3.15 they number in the millions and slow the suite about twentyfold.
1 parent 8d620ca commit cc99d40

12 files changed

Lines changed: 456 additions & 149 deletions

‎.github/workflows/auto-release.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ concurrency:
1616

1717
env:
1818
PYTHON_VERSION: "3.11"
19-
UV_VERSION: "0.12.3"
19+
UV_VERSION: "0.13.1"
2020
AUTO_VERSION: "11.3.6"
2121
RELEASE_BOT_NAME: "applied-ai-releases[bot]"
2222
RELEASE_BOT_EMAIL: "applied-ai-releases[bot]@users.noreply.github.com"

‎.github/workflows/lint.yml‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- main
88

99
env:
10-
UV_VERSION: "0.12.3"
10+
UV_VERSION: "0.13.1"
1111

1212
jobs:
1313
lock:
@@ -43,6 +43,7 @@ jobs:
4343
- "3.12"
4444
- "3.13"
4545
- "3.14"
46+
- "3.15"
4647

4748
steps:
4849
- name: Check out repository
@@ -64,8 +65,18 @@ jobs:
6465
uv.lock
6566
6667
- name: Install dependencies
68+
env:
69+
MATRIX_PYTHON: ${{ matrix.python-version }}
6770
run: |
68-
uv sync --all-extras --frozen
71+
set -euo pipefail
72+
73+
# torch has no cp315 wheels on PyPI yet, so sentence-transformers
74+
# (and `all`, which includes it) cannot install on 3.15.
75+
extras=(--all-extras)
76+
if [ "$MATRIX_PYTHON" = "3.15" ]; then
77+
extras+=(--no-extra sentence-transformers --no-extra all)
78+
fi
79+
uv sync "${extras[@]}" --frozen
6980
7081
- name: check-sort-import
7182
run: |

‎.github/workflows/test-fork-pr.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ permissions:
1515

1616
env:
1717
PYTHON_VERSION: "3.11"
18-
UV_VERSION: "0.12.3"
18+
UV_VERSION: "0.13.1"
1919

2020
jobs:
2121
setup:

‎.github/workflows/test.yml‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414

1515
env:
1616
PYTHON_VERSION: "3.11"
17-
UV_VERSION: "0.12.3"
17+
UV_VERSION: "0.13.1"
1818

1919
jobs:
2020
service-tests:
@@ -83,7 +83,7 @@ jobs:
8383
strategy:
8484
fail-fast: false
8585
matrix:
86-
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
86+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
8787
redis-py-version: ["6.x", "7.x", "8.x"]
8888
# `redis:latest` floats, so a failure on it is not reproducible from a
8989
# SHA; it is advisory below. Pinned tags carry the blocking coverage.
@@ -117,10 +117,19 @@ jobs:
117117
uv.lock
118118
119119
- name: Install dependencies
120+
env:
121+
MATRIX_PYTHON: ${{ matrix.python-version }}
120122
run: |
121123
set -euo pipefail
122124
123-
uv sync --all-extras --frozen
125+
# torch has no cp315 wheels on PyPI yet, so sentence-transformers
126+
# (and `all`, which includes it) cannot install on 3.15. Tests marked
127+
# requires_hf skip themselves when it is missing (tests/conftest.py).
128+
extras=(--all-extras)
129+
if [ "$MATRIX_PYTHON" = "3.15" ]; then
130+
extras+=(--no-extra sentence-transformers --no-extra all)
131+
fi
132+
uv sync "${extras[@]}" --frozen
124133
125134
# Must cover every redis-py-version matrix value; unhandled values fail.
126135
case "$REDIS_PY_VERSION" in

‎pyproject.toml‎

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name = "redisvl"
44
version = "0.28.0"
55
description = "Python client library and CLI for using Redis as a vector database"
66
authors = [{ name = "Redis Inc.", email = "[email protected]" }]
7-
requires-python = ">=3.10,<3.15"
7+
requires-python = ">=3.10,<3.16"
88
readme = "README.md"
99
license = "MIT"
1010
keywords = [
@@ -20,6 +20,7 @@ classifiers = [
2020
"Programming Language :: Python :: 3.12",
2121
"Programming Language :: Python :: 3.13",
2222
"Programming Language :: Python :: 3.14",
23+
"Programming Language :: Python :: 3.15",
2324
"License :: OSI Approved :: MIT License",
2425
]
2526
dependencies = [
@@ -45,6 +46,10 @@ mcp = [
4546
# Supporting that revision is its own piece of work.
4647
"fastmcp>=2.0.0,<4",
4748
"pydantic-settings>=2.0,<3",
49+
# fastmcp pulls in beartype transitively. Releases before 0.23 import
50+
# typing.no_type_check_decorator, which Python 3.15 removed, so fastmcp
51+
# fails to import and the MCP server falls back to its stub.
52+
"beartype>=0.23.1",
4853
]
4954
mistralai = ["mistralai>=1.0.0,<2"]
5055
openai = ["openai>=1.1.0"]
@@ -115,7 +120,7 @@ build-backend = "hatchling.build"
115120

116121
[dependency-groups]
117122
dev = [
118-
"black>=25.1.0,<27",
123+
"black>=26.5.0,<27",
119124
"isort>=5.6.4,<6",
120125
"pylint>=3.1.0,<4",
121126
"pytest>=8.1.1,<9",
@@ -151,7 +156,7 @@ default-groups = [
151156
]
152157

153158
[tool.black]
154-
target-version = ['py310', 'py311', 'py312', 'py313', 'py314']
159+
target-version = ['py310', 'py311', 'py312', 'py313', 'py314', 'py315']
155160
exclude = '''
156161
(
157162
| \.egg
@@ -171,6 +176,14 @@ exclude = '''
171176
[tool.pytest.ini_options]
172177
log_cli = true
173178
asyncio_mode = "auto"
179+
# pytest-asyncio 0.23 calls asyncio APIs that Python 3.14+ deprecates, once
180+
# per collected object. On 3.15 that is millions of warnings per run, which
181+
# slows the suite roughly tenfold. Scoped to pytest_asyncio so the same
182+
# deprecations raised from redisvl still surface. Drop this once the
183+
# pytest-asyncio<0.24 pin is lifted.
184+
filterwarnings = [
185+
"ignore:'asyncio\\.(iscoroutinefunction|get_event_loop_policy|set_event_loop_policy)' is deprecated:DeprecationWarning:pytest_asyncio",
186+
]
174187

175188
[tool.mypy]
176189
warn_unused_configs = true

‎tests/conftest.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import hashlib
2+
import importlib.util
23
import logging
34
import os
45
import re
@@ -533,13 +534,20 @@ def pytest_collection_modifyitems(
533534
skip_cluster = pytest.mark.skip(
534535
reason="Skipping test because Redis cluster is not available. Use --run-cluster-tests to run these tests."
535536
)
537+
# torch, and so sentence-transformers, can lag a new CPython release.
538+
has_hf = importlib.util.find_spec("sentence_transformers") is not None
539+
skip_hf = pytest.mark.skip(
540+
reason="Skipping test because sentence-transformers is not installed."
541+
)
536542

537543
# Apply skip markers independently based on flags
538544
for item in items:
539545
if item.get_closest_marker("requires_api_keys") and not run_api_tests:
540546
item.add_marker(skip_api)
541547
if item.get_closest_marker("requires_cluster") and not run_cluster_tests:
542548
item.add_marker(skip_cluster)
549+
if item.get_closest_marker("requires_hf") and not has_hf:
550+
item.add_marker(skip_hf)
543551

544552

545553
@pytest.fixture

‎tests/integration/test_key_separator_handling.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def test_empty_prefix_handled_correctly(self):
8484
# Should return just the ID without prefix or separator
8585
assert key == "789", f"Expected '789' but got '{key}'"
8686

87+
@pytest.mark.requires_hf
8788
def test_semantic_router_uses_index_separator(self, redis_url):
8889
"""Test that SemanticRouter uses the index's key_separator."""
8990
# Create a route
@@ -188,6 +189,7 @@ def test_trailing_separator_normalization(self):
188189
), f"For prefix='{prefix}', sep='{separator}', id='{id_val}': expected '{expected}' but got '{key}'"
189190

190191

192+
@pytest.mark.requires_hf
191193
class TestSemanticRouterKeyConstruction:
192194
"""Test SemanticRouter's key construction with separators."""
193195

‎tests/integration/test_message_history.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,7 @@ def test_different_vector_dtypes(client, redis_url, redis_test_name):
749749
sess.delete()
750750

751751

752+
@pytest.mark.requires_hf
752753
def test_bad_dtype_connecting_to_exiting_history(client, redis_url, redis_test_name):
753754
skip_if_no_redis_search(client)
754755
# Skip this test for Redis 6.2.x as FT.INFO doesn't return dims properly
@@ -814,6 +815,7 @@ def test_invalid_vectorizer(client, redis_url, redis_test_name):
814815
)
815816

816817

818+
@pytest.mark.requires_hf
817819
def test_passes_through_dtype_to_default_vectorizer(client, redis_url, redis_test_name):
818820
skip_if_no_redis_search(client)
819821
# The default is float32, so we should see float64 if we pass it in.
@@ -834,6 +836,7 @@ def test_passes_through_dtype_to_default_vectorizer(client, redis_url, redis_tes
834836
cache.delete()
835837

836838

839+
@pytest.mark.requires_hf
837840
def test_deprecated_dtype_argument(client, redis_url, redis_test_name):
838841
skip_if_no_redis_search(client)
839842
history = None

‎tests/integration/test_role_filter_get_recent.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ def test_get_recent_role_with_raw_output(self, redis_url):
267267
history.delete()
268268

269269

270+
@pytest.mark.requires_hf
270271
class TestSemanticMessageHistoryRoleFilter:
271272
"""Test role filtering functionality in SemanticMessageHistory with real Redis."""
272273

‎tests/unit/test_error_handling.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ async def test_connection_kwargs_type_error(self):
190190
await cache._get_async_redis_client()
191191

192192
error_msg = str(exc_info.value)
193-
assert "argument after ** must be a mapping" in error_msg
193+
# CPython 3.15 reworded this from "argument after **" to "Value after **".
194+
assert "after ** must be a mapping" in error_msg
194195

195196
@pytest.mark.asyncio
196197
async def test_connection_kwargs_valid_dict(self):

0 commit comments

Comments
 (0)