mirror of
https://github.com/lancedb/lancedb.git
synced 2025-12-25 22:29:58 +00:00
@eddyxu added instructions for linting here:
7af213801a/python/README.md (L45-L50)
However, we had a lot of failures and weren't checking this in CI. This
PR fixes all lints and adds a check to CI to keep us in compliance with
the lints.
108 lines
2.8 KiB
YAML
108 lines
2.8 KiB
YAML
name: Python
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
paths:
|
|
- python/**
|
|
- .github/workflows/python.yml
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
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 .[tests]
|
|
pip install tantivy@git+https://github.com/quickwit-oss/tantivy-py#164adc87e1a033117001cf70e38c82a53014d985
|
|
pip install pytest pytest-mock ruff
|
|
- name: Format check
|
|
run: ruff format --check .
|
|
- name: Lint
|
|
run: ruff .
|
|
- name: Run tests
|
|
run: pytest -m "not slow" -x -v --durations=30 tests
|
|
- name: doctest
|
|
run: pytest --doctest-modules lancedb
|
|
platform:
|
|
name: "Platform: ${{ matrix.config.name }}"
|
|
timeout-minutes: 30
|
|
strategy:
|
|
matrix:
|
|
config:
|
|
- name: x86 Mac
|
|
runner: macos-13
|
|
- name: Arm Mac
|
|
runner: macos-13-xlarge
|
|
- name: x86 Windows
|
|
runner: windows-latest
|
|
runs-on: "${{ matrix.config.runner }}"
|
|
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.11"
|
|
- name: Install lancedb
|
|
run: |
|
|
pip install -e .[tests]
|
|
pip install tantivy@git+https://github.com/quickwit-oss/tantivy-py#164adc87e1a033117001cf70e38c82a53014d985
|
|
pip install pytest pytest-mock
|
|
- name: Run tests
|
|
run: pytest -m "not slow" -x -v --durations=30 tests
|
|
pydantic1x:
|
|
timeout-minutes: 30
|
|
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.9
|
|
- name: Install lancedb
|
|
run: |
|
|
pip install "pydantic<2"
|
|
pip install -e .[tests]
|
|
pip install tantivy@git+https://github.com/quickwit-oss/tantivy-py#164adc87e1a033117001cf70e38c82a53014d985
|
|
pip install pytest pytest-mock
|
|
- name: Run tests
|
|
run: pytest -m "not slow" -x -v --durations=30 tests
|
|
- name: doctest
|
|
run: pytest --doctest-modules lancedb
|