Commit 2284616
authored
refactor(python): drop Python 3.9 support (#587)
## Summary
This PR drops Python 3.9 support from RedisVL and makes Python 3.10 the
project minimum. That change is carried through package metadata, the
lockfile, CI configuration, repo-owned documentation, and the codebase’s
type annotations so the stated support policy and the implementation
match.
## Motivation
Supporting Python 3.9 was already imposing ongoing cost in a few
different ways. It required extra compatibility handling, kept the
project split between core-package and MCP-specific runtime messaging,
and forced older annotation syntax across large parts of the repository.
Python 3.9 is also past its official end-of-life, so continuing to carry
support for it no longer has a strong maintenance or ecosystem
justification. The project already targets newer runtimes in practice,
which makes keeping 3.9 mostly maintenance overhead.
## Changes
The support-floor change starts in packaging and CI. `pyproject.toml`,
`uv.lock`, and the GitHub Actions workflows now treat Python 3.10 as the
minimum supported version, while preserving current newer-runtime
coverage, including Python 3.14 in lint and test configuration. This
aligns the declared support policy with the environments the project is
expected to run and validate against.
The library code has also been updated to use Python 3.10-native typing
syntax throughout repo-owned Python sources. Legacy `typing` container
aliases and `Optional`/`Union` forms were replaced with built-in
generics and `|` unions where valid, while runtime-sensitive sites were
adjusted manually so forward references, type checks, and
schema/type-introspection behavior remain valid without adding `from
__future__ import annotations`.
Additional follow-up changes include:
- Moving `Annotated` imports to the standard library where supported
- Keeping `typing_extensions.Self` in place where it is still required
for Python 3.10 compatibility
- Removing the redundant MCP CLI runtime guard that duplicated the
package-level Python requirement
- Updating README content, installation guidance, MCP docs, notebook
prose, and tests that assert exact type-hint shapes so they align with
the new support floor and modernized annotations
## Note for Reviewers
The docs build still reports existing Sphinx warnings that are unrelated
to this PR.
## Testing
The following checks were run during development:
- `make check-sort-imports`
- `make check-format`
- `make check-types`
- `uv run python -m tests.test_imports redisvl`
- `uv run python -m pytest tests/unit/test_validation.py
tests/unit/test_index_schema_type_issue.py
tests/unit/test_base_vectorizer.py tests/unit/test_cli_utils.py
tests/unit/test_hybrid_types.py
tests/unit/test_mcp/test_search_tool_unit.py
tests/unit/test_mcp/test_upsert_tool_unit.py
tests/integration/test_mcp/test_server_startup.py
tests/integration/test_mcp/test_upsert_tool.py -q`
- `make docs-build`
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Medium risk because it is a breaking support-policy change (Python
>=3.10) and touches broad, core surfaces
(index/storage/cache/router/CLI) via widespread type-annotation
refactors that could affect runtime edge cases if any typing changes
leaked into behavior.
>
> **Overview**
> Drops Python 3.9 support across the project: updates `pyproject.toml`
(`requires-python` >=3.10), removes 3.9 from classifiers/Black targets,
and adjusts optional dependency markers now that the whole package
requires 3.10+.
>
> Aligns CI and docs with the new minimum by removing 3.9 from the test
matrix, adding 3.14 to lint, and updating installation/MCP documentation
and a notebook to state Python 3.10+.
>
> Modernizes repo-owned Python sources to Python 3.10 typing syntax
(built-in generics and `|` unions) across caches, message history,
router, and the core `SearchIndex`/storage layer, and removes the
redundant MCP CLI runtime version guard.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
57bb351. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 7cafaa0 commit 2284616
80 files changed
Lines changed: 1290 additions & 2763 deletions
File tree
- .github/workflows
- docs
- _extension
- user_guide
- how_to_guides
- redisvl
- cli
- extensions
- cache
- embeddings
- llm
- message_history
- router
- index
- mcp
- tools
- query
- redis
- schema
- utils
- rerank
- vectorize
- text
- tests
- integration
- test_mcp
- unit
- test_mcp
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | 18 | | |
26 | | - | |
27 | 19 | | |
28 | 20 | | |
29 | 21 | | |
30 | 22 | | |
| 23 | + | |
31 | 24 | | |
32 | 25 | | |
33 | 26 | | |
| |||
62 | 55 | | |
63 | 56 | | |
64 | 57 | | |
65 | | - | |
| 58 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
62 | 60 | | |
63 | 61 | | |
64 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
| 148 | + | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
| 161 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
436 | 436 | | |
437 | 437 | | |
438 | 438 | | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | 439 | | |
444 | 440 | | |
445 | 441 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | 57 | | |
62 | 58 | | |
63 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
| |||
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
39 | | - | |
| 38 | + | |
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
| |||
102 | 101 | | |
103 | 102 | | |
104 | 103 | | |
105 | | - | |
| 104 | + | |
106 | 105 | | |
107 | 106 | | |
108 | 107 | | |
| |||
124 | 123 | | |
125 | 124 | | |
126 | 125 | | |
127 | | - | |
| 126 | + | |
128 | 127 | | |
129 | 128 | | |
130 | 129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | 76 | | |
78 | 77 | | |
79 | 78 | | |
| |||
94 | 93 | | |
95 | 94 | | |
96 | 95 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | 96 | | |
112 | 97 | | |
113 | 98 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
25 | | - | |
| 24 | + | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
| |||
0 commit comments