From 4f0785e381705cc9f1e77f7eb2c791104a3ef06c Mon Sep 17 00:00:00 2001 From: Chang She <759245+changhiskhan@users.noreply.github.com> Date: Wed, 22 Mar 2023 14:26:21 -0700 Subject: [PATCH 1/3] add GHA for python unit tests --- .github/workflows/python.yml | 58 ++++++++++++++++++++++++++++++++++++ js/package.json | 19 ------------ rust/Cargo.toml | 7 ----- rust/src/lib.rs | 0 4 files changed, 58 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/python.yml delete mode 100644 js/package.json delete mode 100644 rust/Cargo.toml delete mode 100644 rust/src/lib.rs diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml new file mode 100644 index 000000000..347274120 --- /dev/null +++ b/.github/workflows/python.yml @@ -0,0 +1,58 @@ +name: Python + +on: + push: + branches: + - main + pull_request: + paths: + - python/** + - .github/workflows/python.yml +jobs: + linux: + timeout-minutes: 30 + strategy: + matrix: + python-minor-version: [ "8", "9", "10", "11" ] + runs-on: "ubuntu-22.04" + defaults: + run: + shell: bash + working-directory: python + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + lfs: true + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.${{ matrix.python-minor-version }} + - name: Install lancedb + run: | + pip install -e . + pip install pytest + - name: Run tests + run: pytest -x -v --durations=30 python/tests + mac: + timeout-minutes: 30 + runs-on: "macos-12" + defaults: + run: + shell: bash + working-directory: python + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + lfs: true + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Install lancedb + run: | + pip install -e . + pip install pytest + - name: Run tests + run: pytest -x -v --durations=30 python/tests \ No newline at end of file diff --git a/js/package.json b/js/package.json deleted file mode 100644 index 26b93f999..000000000 --- a/js/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "lancedb", - "version": "0.0.1", - "author": "lance devs ", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/eto-ai/lancedb.git" - }, - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/eto-ai/lancedb/issues" - }, - "homepage": "https://github.com/eto-ai/lancedb#readme", - "description": "" -} diff --git a/rust/Cargo.toml b/rust/Cargo.toml deleted file mode 100644 index 8acc1b557..000000000 --- a/rust/Cargo.toml +++ /dev/null @@ -1,7 +0,0 @@ -[package] -name = "lancedb" -version = "0.0.1" -authors = ["Lance Developers"] -autobins = false -description = "Lance DB" -license-file = "../LICENSE" \ No newline at end of file diff --git a/rust/src/lib.rs b/rust/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 From c45b4dbd27c121f885cf2c1034fd669d94ec43e0 Mon Sep 17 00:00:00 2001 From: Chang She <759245+changhiskhan@users.noreply.github.com> Date: Wed, 22 Mar 2023 14:30:27 -0700 Subject: [PATCH 2/3] fix directory --- .github/workflows/python.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 347274120..c66d81f29 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -33,7 +33,7 @@ jobs: pip install -e . pip install pytest - name: Run tests - run: pytest -x -v --durations=30 python/tests + run: pytest -x -v --durations=30 tests mac: timeout-minutes: 30 runs-on: "macos-12" @@ -55,4 +55,4 @@ jobs: pip install -e . pip install pytest - name: Run tests - run: pytest -x -v --durations=30 python/tests \ No newline at end of file + run: pytest -x -v --durations=30 tests \ No newline at end of file From 429246416a5c5f5d846c46c6ce7fb333bd77c580 Mon Sep 17 00:00:00 2001 From: Chang She <759245+changhiskhan@users.noreply.github.com> Date: Wed, 22 Mar 2023 14:32:12 -0700 Subject: [PATCH 3/3] 3.8 compat --- python/lancedb/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/lancedb/common.py b/python/lancedb/common.py index 3154cdbb8..9566325fb 100644 --- a/python/lancedb/common.py +++ b/python/lancedb/common.py @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. from pathlib import Path -from typing import Union +from typing import Union, List import numpy as np import pandas as pd @@ -21,5 +21,5 @@ VEC = Union[list, np.ndarray, pa.Array, pa.ChunkedArray] URI = Union[str, Path] # TODO support generator -DATA = Union[list[dict], dict, pd.DataFrame] +DATA = Union[List[dict], dict, pd.DataFrame] VECTOR_COLUMN_NAME = "vector"