Hide IVF behind SQLITE_VEC_EXPERIMENTAL_IVF_ENABLE, default off

Rename SQLITE_VEC_ENABLE_IVF to SQLITE_VEC_EXPERIMENTAL_IVF_ENABLE and
flip the default from 1 to 0. IVF tests are automatically skipped when
the build flag is not set.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alex Garcia 2026-03-30 23:17:30 -07:00
parent 3e26925ce0
commit bb3ef78f75
2 changed files with 45 additions and 21 deletions

View file

@ -1,5 +1,29 @@
import pytest
import sqlite3
import os
def _vec_debug():
db = sqlite3.connect(":memory:")
db.enable_load_extension(True)
db.load_extension("dist/vec0")
db.enable_load_extension(False)
return db.execute("SELECT vec_debug()").fetchone()[0]
def _has_build_flag(flag):
return flag in _vec_debug().split("Build flags:")[-1]
def pytest_collection_modifyitems(config, items):
has_ivf = _has_build_flag("ivf")
if has_ivf:
return
skip_ivf = pytest.mark.skip(reason="IVF not enabled (compile with -DSQLITE_VEC_EXPERIMENTAL_IVF_ENABLE=1)")
ivf_prefixes = ("test-ivf",)
for item in items:
if any(item.fspath.basename.startswith(p) for p in ivf_prefixes):
item.add_marker(skip_ivf)
@pytest.fixture()