From 419f4f4e008a059d07fdfba8f69fdc0a83178d73 Mon Sep 17 00:00:00 2001 From: alex-mcgovern Date: Tue, 21 Jan 2025 16:15:01 +0000 Subject: [PATCH] revert: Revert back to sqlite-vec from fork now upstream is fixed (#632) --- poetry.lock | 18 ++++++++---------- pyproject.toml | 4 ++-- scripts/import_packages.py | 4 ++-- src/codegate/storage/storage_engine.py | 4 ++-- tests/vectordb/test_sqlitevec.py | 2 +- 5 files changed, 15 insertions(+), 17 deletions(-) diff --git a/poetry.lock b/poetry.lock index c35ef160..e2d21593 100644 --- a/poetry.lock +++ b/poetry.lock @@ -604,7 +604,6 @@ files = [ {file = "cryptography-44.0.0-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:761817a3377ef15ac23cd7834715081791d4ec77f9297ee694ca1ee9c2c7e5eb"}, {file = "cryptography-44.0.0-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:3c672a53c0fb4725a29c303be906d3c1fa99c32f58abe008a82705f9ee96f40b"}, {file = "cryptography-44.0.0-cp37-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:4ac4c9f37eba52cb6fbeaf5b59c152ea976726b865bd4cf87883a7e7006cc543"}, - {file = "cryptography-44.0.0-cp37-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:60eb32934076fa07e4316b7b2742fa52cbb190b42c2df2863dbc4230a0a9b385"}, {file = "cryptography-44.0.0-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:ed3534eb1090483c96178fcb0f8893719d96d5274dfde98aa6add34614e97c8e"}, {file = "cryptography-44.0.0-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:f3f6fdfa89ee2d9d496e2c087cebef9d4fcbb0ad63c40e821b39f74bf48d9c5e"}, {file = "cryptography-44.0.0-cp37-abi3-win32.whl", hash = "sha256:eb33480f1bad5b78233b0ad3e1b0be21e8ef1da745d8d2aecbb20671658b9053"}, @@ -615,7 +614,6 @@ files = [ {file = "cryptography-44.0.0-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:c5eb858beed7835e5ad1faba59e865109f3e52b3783b9ac21e7e47dc5554e289"}, {file = "cryptography-44.0.0-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:f53c2c87e0fb4b0c00fa9571082a057e37690a8f12233306161c8f4b819960b7"}, {file = "cryptography-44.0.0-cp39-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:9e6fc8a08e116fb7c7dd1f040074c9d7b51d74a8ea40d4df2fc7aa08b76b9e6c"}, - {file = "cryptography-44.0.0-cp39-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:9abcc2e083cbe8dde89124a47e5e53ec38751f0d7dfd36801008f316a127d7ba"}, {file = "cryptography-44.0.0-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:d2436114e46b36d00f8b72ff57e598978b37399d2786fd39793c36c6d5cb1c64"}, {file = "cryptography-44.0.0-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:a01956ddfa0a6790d594f5b34fc1bfa6098aca434696a03cfdbe469b8ed79285"}, {file = "cryptography-44.0.0-cp39-abi3-win32.whl", hash = "sha256:eca27345e1214d1b9f9490d200f9db5a874479be914199194e746c893788d417"}, @@ -2593,17 +2591,17 @@ pymysql = ["pymysql"] sqlcipher = ["sqlcipher3_binary"] [[package]] -name = "sqlite-vec" -version = "0.1.6" +name = "sqlite-vec-sl-tmp" +version = "0.0.4" description = "" optional = false python-versions = "*" files = [ - {file = "sqlite_vec-0.1.6-py3-none-macosx_10_6_x86_64.whl", hash = "sha256:77491bcaa6d496f2acb5cc0d0ff0b8964434f141523c121e313f9a7d8088dee3"}, - {file = "sqlite_vec-0.1.6-py3-none-macosx_11_0_arm64.whl", hash = "sha256:fdca35f7ee3243668a055255d4dee4dea7eed5a06da8cad409f89facf4595361"}, - {file = "sqlite_vec-0.1.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7b0519d9cd96164cd2e08e8eed225197f9cd2f0be82cb04567692a0a4be02da3"}, - {file = "sqlite_vec-0.1.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux1_x86_64.whl", hash = "sha256:823b0493add80d7fe82ab0fe25df7c0703f4752941aee1c7b2b02cec9656cb24"}, - {file = "sqlite_vec-0.1.6-py3-none-win_amd64.whl", hash = "sha256:c65bcfd90fa2f41f9000052bcb8bb75d38240b2dae49225389eca6c3136d3f0c"}, + {file = "sqlite_vec_sl_tmp-0.0.4-py3-none-macosx_10_6_x86_64.whl", hash = "sha256:5ff08375a51d9d8284b4e14a6a2ccb8faabc5fe8e82953b8a8861302ef2ab147"}, + {file = "sqlite_vec_sl_tmp-0.0.4-py3-none-macosx_11_0_arm64.whl", hash = "sha256:0a8ad2980e95067560670c24afc6a6ba43227387f8c38e833ae8c7d9382080f2"}, + {file = "sqlite_vec_sl_tmp-0.0.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f6e42acd915e7c54f57b57c2fa7dae08e4e456ca94d3d3bddaa1a178c99e4ece"}, + {file = "sqlite_vec_sl_tmp-0.0.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux1_x86_64.whl", hash = "sha256:4acd5d16770f29f625398ce35e4d71bbbf5e66ae659d06c0a42dcd6289071daa"}, + {file = "sqlite_vec_sl_tmp-0.0.4-py3-none-win_amd64.whl", hash = "sha256:737a3924cb903d5bf81de17bfef8f24ac9c97c0ffd3fbc88b42d9b1747e3939a"}, ] [[package]] @@ -3085,4 +3083,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = ">=3.12,<4.0" -content-hash = "2a251329f770d2d3abc286da3d75ce1c2190d902b4504a0ea15329d2bb82bb87" +content-hash = "ef1e93781cca25233726ffb4b27ac9fb148452fc9e368ed8732c3fc2001fb808" diff --git a/pyproject.toml b/pyproject.toml index 02fcb3b8..21d51682 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ tree-sitter-python = "==0.23.6" tree-sitter-rust = "==0.23.2" alembic = "==1.14.1" pygments = "==2.19.1" -sqlite-vec = "==0.1.6" +sqlite-vec-sl-tmp = "==0.0.4" [tool.poetry.group.dev.dependencies] pytest = "==8.3.4" @@ -62,7 +62,7 @@ line-length = 100 target-version = "py310" fix = true exclude = [ - "src/codegate/db/queries.py", # Ignore auto-generated file from sqlc + "src/codegate/db/queries.py", # Ignore auto-generated file from sqlc ] [tool.ruff.lint] diff --git a/scripts/import_packages.py b/scripts/import_packages.py index 58343552..e96d65e1 100644 --- a/scripts/import_packages.py +++ b/scripts/import_packages.py @@ -5,7 +5,7 @@ import sqlite3 import numpy as np -import sqlite_vec +import sqlite_vec_sl_tmp from codegate.inference.inference_engine import LlamaCppInferenceEngine from codegate.utils.utils import generate_vector_string @@ -27,7 +27,7 @@ def __init__(self, jsonl_dir="data", vec_db_path="./sqlite_data/vectordb.db"): def _get_connection(self): conn = sqlite3.connect(self.vec_db_path) conn.enable_load_extension(True) - sqlite_vec.load(conn) + sqlite_vec_sl_tmp.load(conn) conn.enable_load_extension(False) return conn diff --git a/src/codegate/storage/storage_engine.py b/src/codegate/storage/storage_engine.py index 7946f794..afd5cbd7 100644 --- a/src/codegate/storage/storage_engine.py +++ b/src/codegate/storage/storage_engine.py @@ -4,7 +4,7 @@ from typing import List import numpy as np -import sqlite_vec +import sqlite_vec_sl_tmp import structlog from codegate.config import Config @@ -69,7 +69,7 @@ def _get_connection(self): try: conn = sqlite3.connect(self.db_path) conn.enable_load_extension(True) - sqlite_vec.load(conn) + sqlite_vec_sl_tmp.load(conn) conn.enable_load_extension(False) return conn except Exception as e: diff --git a/tests/vectordb/test_sqlitevec.py b/tests/vectordb/test_sqlitevec.py index d70c1ab8..e47ceb8f 100644 --- a/tests/vectordb/test_sqlitevec.py +++ b/tests/vectordb/test_sqlitevec.py @@ -10,7 +10,7 @@ @pytest.fixture(scope="module") def mock_sqlite_vec(): - with patch("sqlite_vec.load") as mock_load: + with patch("sqlite_vec_sl_tmp.load") as mock_load: # Mock the vector similarity extension loading def setup_vector_similarity(conn): cursor = conn.cursor()