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: Lint run: ruff format --check . - name: Run tests run: pytest -m "not slow" -x -v --durations=30 tests - name: doctest run: pytest --doctest-modules lancedb mac: timeout-minutes: 30 strategy: matrix: mac-runner: [ "macos-13", "macos-13-xlarge" ] runs-on: "${{ matrix.mac-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 black - 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 black isort - name: Black run: black --check --diff --no-color --quiet . - name: isort run: isort --check --diff --quiet . - name: Run tests run: pytest -m "not slow" -x -v --durations=30 tests - name: doctest run: pytest --doctest-modules lancedb