chore!: drop Python 3.10 support (#5172)

Closes #5106.

Python 3.10 reached end of life on 2026-10-01. This raises the minimum
to 3.11, following #2955 for 3.9. It's marked `chore!:` because it's a
breaking change for 3.10 users.

- `python/pyproject.toml`: `requires-python = ">=3.11"`, and the 3.10
classifier is removed. The `pillow` lower bound in the `clip`, `siglip`
and `embeddings` extras goes up to `>=13.0.0`, the release with the CVE
fixes, which needs 3.11+. The `typing-extensions; python_version <
"3.11"` dev dependency is removed, since it no longer applies.
- `python/Cargo.toml`: pyo3 `abi3-py310` becomes `abi3-py311`, so wheels
are built as `cp311-abi3`.
- `python/lancedb/query.py`: `Self` comes from `typing`, without the
`typing_extensions` fallback.
- CI: the Linux test matrix goes from `["10", "13"]` to `["11", "13"]`,
and the minimum-dependencies job, the release build (`pypi-publish.yml`)
and the docs build move from 3.10 to 3.11.
- `python/uv.lock`: regenerated with `uv lock --extra-index-url
https://pypi.fury.io/lance-format/`. The only changes are the 3.10-only
resolutions going away: all 74 `python_full_version < '3.11'` markers,
`async-timeout`, `backports-asyncio-runner`, `exceptiongroup`, `tomli`,
and the older numpy, scipy, pandas, pyarrow and pillow pins. No package
version changes for 3.11+.

Checks run locally: `ruff check` and `ruff format --check` pass, and
`cargo metadata` succeeds for the workspace. I haven't run the Python
test suite, which needs the native build, so I'm relying on CI for that.

pylance still declares `>=3.10`. As the issue says, lancedb can move
first because pylance is optional.


![Evidence](https://raw.githubusercontent.com/rahulsjha/lancedb/pr-assets/lance5106-evidence.png)

---------

Co-authored-by: Will Jones <willjones127@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Rahul
2026-11-23 17:30:18 -08:00
committed by GitHub
co-authored by Will Jones Claude Opus 5.5
parent fe2d2b33fc
commit 52209f10c3
10 changed files with 69 additions and 1158 deletions
+1 -6
View File
@@ -62,7 +62,7 @@ from ._blob import (
from .types import BlobMode, QueryProjection
if TYPE_CHECKING:
import sys
from typing import Self
import PIL
import polars as pl
@@ -77,11 +77,6 @@ if TYPE_CHECKING:
from .pydantic import LanceModel
from .table import AsyncTable, Table
if sys.version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self
T = TypeVar("T", bound="LanceModel")
+5 -1
View File
@@ -1374,7 +1374,11 @@ async def test_profile_wait_preserves_timeout_and_never_waits_or_cancels_parent(
await asyncio.to_thread(Job(job).wait_for_profile, "profile-1", **kwargs)
else:
await job.wait_for_profile("profile-1", **kwargs)
assert caught.value is error
assert caught.value.args == error.args
# On Python 3.11 and 3.12, run_coroutine_threadsafe re-creates TimeoutError
# when copying it across futures, so identity only holds on the async path.
if not sync:
assert caught.value is error
inner.wait_for_profile.assert_awaited_once_with(
"profile-1", timeout_seconds=0.05, poll_interval_seconds=5.0
)
+10 -1
View File
@@ -68,8 +68,17 @@ def test_windows_wheel_tag_and_native_import():
if not wheels:
pytest.skip("no wheel artifact is available in this development environment")
# The wheel is tagged with the abi3 floor, which follows requires-python.
minimum_python = re.search(
r'^requires-python\s*=\s*">=(\d+)\.(\d+)"$',
(project_dir / "pyproject.toml").read_text(),
re.MULTILINE,
)
assert minimum_python is not None
major, minor = minimum_python.groups()
assert len(wheels) == 1
assert wheels[0].name.endswith("-cp310-abi3-win_amd64.whl")
assert wheels[0].name.endswith(f"-cp{major}{minor}-abi3-win_amd64.whl")
native_module = importlib.import_module("lancedb._lancedb")
assert Path(native_module.__file__).suffix == ".pyd"