feat: add Python 3.13 and 3.14 support (#164)

* feat: add Python 3.13 and 3.14 support

- Add Python 3.13 and 3.14 classifiers to pyproject.toml
- Add cp313 and cp314 cibuildwheel build targets
- Add Python 3.13 and 3.14 to CI test matrix
- Enable allow-prereleases for setup-python (required for 3.14 alpha)

Signed-off-by: Maxime Grenu <maxime.grenu@gmail.com>

* ci: retrigger (flaky Int4SquaredEuclideanMetric tolerance on linux-x64)

Signed-off-by: Maxime Grenu <maxime.grenu@gmail.com>

* fix: widen Int4 distance matrix test tolerance from 1e-4 to 5e-4

Int4 quantization uses only 16 levels per dimension (vs 256 for Int8),
resulting in larger rounding errors in distance computations. The
previous 1e-4 absolute tolerance was too tight and caused flaky
failures (observed diff: 1.22e-4 on values ~523.77). The Int8 test
already has this EXPECT_NEAR commented out, relying solely on the
relative IsAlmostEqual check.

Signed-off-by: Maxime Grenu <maxime.grenu@gmail.com>

* fix: remove allow-prereleases flag for Python 3.14

Python 3.14 is now a stable release (v3.14.3, released Oct 2025),
so allow-prereleases: true is no longer needed in setup-python.

Signed-off-by: Maxime Kawawa-Beaudan <maxkb@meta.com>
Signed-off-by: Maxime Grenu <maxime.grenu@gmail.com>

---------

Signed-off-by: Maxime Grenu <maxime.grenu@gmail.com>
Signed-off-by: Maxime Kawawa-Beaudan <maxkb@meta.com>
This commit is contained in:
Maxime Grenu
2026-02-28 14:37:43 +08:00
committed by GitHub
parent 4e420311df
commit 3c38a8b94c
3 changed files with 8 additions and 3 deletions
+3 -2
View File
@@ -70,13 +70,14 @@ jobs:
# Build and test matrix (parallel execution)
build-and-test:
name: Build & Test (${{ matrix.platform }})
name: Build & Test (${{ matrix.platform }}, py${{ matrix.python-version }})
needs: lint
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.13', '3.14']
include:
- os: macos-15
platform: macos-arm64
@@ -97,7 +98,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.10'
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: 'pyproject.toml'
+4
View File
@@ -27,6 +27,8 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Database",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development :: Libraries :: Python Modules",
@@ -161,6 +163,8 @@ build = [
"cp310-*",
"cp311-*",
"cp312-*",
"cp313-*",
"cp314-*",
]
build-frontend = "build"
test-requires = ["pytest", "numpy"]
@@ -516,7 +516,7 @@ void TestDistanceMatrixInt4(const std::string &metric_name) {
matrix_compute(&matrix2[0], &query2[0], meta2.dimension(), &result2[0]);
for (size_t i = 0; i < batch_size * query_size; ++i) {
EXPECT_NEAR(result1[i], result2[i], 1e-4);
EXPECT_NEAR(result1[i], result2[i], 5e-4);
EXPECT_TRUE(IsAlmostEqual(result1[i], result2[i], 1e4));
}
}