Skip to content

Commit c1917de

Browse files
committed
Add minimum files for Python build
1 parent a2dd24f commit c1917de

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

bindings/python/pyproject.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[build-system]
2+
requires = ["setuptools", "setuptools_scm"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "sqlite-vec"
7+
description = "A vector search SQLite extension."
8+
dynamic = ["version"]
9+
readme = "README.md"
10+
requires-python = ">=3.12"
11+
dependencies = [
12+
"numpy"
13+
]

bindings/python/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
numpy >= 2.3.0
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from os import path
2+
import sqlite3
3+
4+
def loadable_path():
5+
""" Returns the full path to the sqlite-vec loadable SQLite extension bundled with this package """
6+
7+
# loadable_path = path.join(path.dirname(__file__), "vec0")
8+
vec0_path = "@libpath@"+"vec0" # This is replaced by the build system with the actual path to the vec0 library
9+
return path.normpath(vec0_path)
10+
11+
def load(conn: sqlite3.Connection) -> None:
12+
""" Load the sqlite-vec SQLite extension into the given database connection. """
13+
14+
conn.load_extension(loadable_path())
15+
16+
from .extra_init import *

0 commit comments

Comments
 (0)