move tantivy-py installation to be separate from wheel (#97)

pypi does not allow packages to be uploaded that has a direct reference

for now we'll just ask the user to install tantivy separately

---------

Co-authored-by: Chang She <chang@lancedb.com>
This commit is contained in:
Chang She
2023-05-25 17:57:26 -06:00
committed by GitHub
parent 22aa8a93c2
commit 04d97347d7
9 changed files with 16 additions and 14 deletions

View File

@@ -30,7 +30,8 @@ jobs:
python-version: 3.${{ matrix.python-minor-version }} python-version: 3.${{ matrix.python-minor-version }}
- name: Install lancedb - name: Install lancedb
run: | run: |
pip install -e ".[fts]" pip install -e .
pip install tantivy@git+https://github.com/quickwit-oss/tantivy-py#164adc87e1a033117001cf70e38c82a53014d985
pip install pytest pip install pytest
- name: Run tests - name: Run tests
run: pytest -x -v --durations=30 tests run: pytest -x -v --durations=30 tests
@@ -52,7 +53,8 @@ jobs:
python-version: "3.11" python-version: "3.11"
- name: Install lancedb - name: Install lancedb
run: | run: |
pip install -e ".[fts]" pip install -e .
pip install tantivy@git+https://github.com/quickwit-oss/tantivy-py#164adc87e1a033117001cf70e38c82a53014d985
pip install pytest pip install pytest
- name: Run tests - name: Run tests
run: pytest -x -v --durations=30 tests run: pytest -x -v --durations=30 tests

View File

@@ -6,9 +6,10 @@ to make this available for JS as well.
## Installation ## Installation
To use full text search, you must install the fts optional dependencies: To use full text search, you must install optional dependency tantivy-py:
`pip install lancedb[fts]` # tantivy 0.19.2
pip install tantivy@git+https://github.com/quickwit-oss/tantivy-py#164adc87e1a033117001cf70e38c82a53014d985
## Quickstart ## Quickstart

View File

@@ -16,7 +16,13 @@ import os
from typing import List, Tuple from typing import List, Tuple
import pyarrow as pa import pyarrow as pa
import tantivy
try:
import tantivy
except ImportError:
raise ImportError(
"Please install tantivy-py `pip install tantivy@git+https://github.com/quickwit-oss/tantivy-py#164adc87e1a033117001cf70e38c82a53014d985` to use the full text search feature."
)
from .table import LanceTable from .table import LanceTable

View File

@@ -153,7 +153,7 @@ class LanceFtsQueryBuilder(LanceQueryBuilder):
import tantivy import tantivy
except ImportError: except ImportError:
raise ImportError( raise ImportError(
"You need to install the `lancedb[fts]` extra to use this method." "Please install tantivy-py `pip install tantivy@git+https://github.com/quickwit-oss/tantivy-py#164adc87e1a033117001cf70e38c82a53014d985` to use the full text search feature."
) )
from .fts import search_index from .fts import search_index

View File

@@ -45,10 +45,6 @@ dev = [
docs = [ docs = [
"mkdocs", "mkdocs-jupyter", "mkdocs-material", "mkdocstrings[python]" "mkdocs", "mkdocs-jupyter", "mkdocs-material", "mkdocstrings[python]"
] ]
fts = [
# tantivy 0.19.2
"tantivy@git+https://github.com/quickwit-oss/tantivy-py#164adc87e1a033117001cf70e38c82a53014d985"
]
[build-system] [build-system]
requires = [ requires = [

View File

@@ -14,7 +14,6 @@ import sys
import numpy as np import numpy as np
import pyarrow as pa import pyarrow as pa
from lancedb.embeddings import with_embeddings from lancedb.embeddings import with_embeddings

View File

@@ -13,13 +13,13 @@
import os import os
import random import random
import lancedb.fts
import numpy as np import numpy as np
import pandas as pd import pandas as pd
import pytest import pytest
import tantivy import tantivy
import lancedb as ldb import lancedb as ldb
import lancedb.fts
@pytest.fixture @pytest.fixture

View File

@@ -17,7 +17,6 @@ import pandas as pd
import pandas.testing as tm import pandas.testing as tm
import pyarrow as pa import pyarrow as pa
import pytest import pytest
from lancedb.query import LanceQueryBuilder from lancedb.query import LanceQueryBuilder

View File

@@ -16,7 +16,6 @@ from pathlib import Path
import pandas as pd import pandas as pd
import pyarrow as pa import pyarrow as pa
import pytest import pytest
from lancedb.table import LanceTable from lancedb.table import LanceTable