Skip to content

rust(feat): parquet scpr/mcpr imports #2696

rust(feat): parquet scpr/mcpr imports

rust(feat): parquet scpr/mcpr imports #2696

Workflow file for this run

name: python-ci
on:
release:
types: [ created ]
pull_request:
push:
branches:
- main
paths:
- 'python/**'
- 'rust/crates/sift_stream_bindings/**'
- '.github/workflows/python_ci.yaml'
workflow_call:
permissions:
contents: read
pull-requests: read
jobs:
changes:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
outputs:
python: ${{ steps.filter.outputs.python }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
python:
- 'python/**'
- 'rust/crates/sift_stream_bindings/**'
- '.github/workflows/python_ci.yaml'
test-python:
needs: [changes]
if: |
always() &&
(github.event_name != 'pull_request' || needs.changes.outputs.python == 'true')
runs-on: ubuntu-latest
defaults:
run:
working-directory: python
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Pip install
id: install
run: |
python -m pip install --upgrade pip
pip install '.[dev-all]'
- name: Lint
run: |
ruff check
- name: Format
run: |
ruff format --check
- name: MyPy
run: |
mypy lib
# Re-run mypy with --platform=win32 so typeshed evaluates platform-gated
# stubs (e.g. fcntl) as if we were on Windows. Catches imports that
# would only fail at runtime on Windows.
- name: MyPy (Windows platform)
run: |
mypy --platform=win32 lib
- name: Pyright
run: |
pyright lib
- name: Check Stubs Generation
working-directory: .
run: |
bash .githooks/pre-push-python/stubs.sh
- name: Check Extras Generation
working-directory: .
run: |
bash .githooks/pre-push-python/extras.sh
- name: Pytest Unit Tests
run: |
pytest -m "not integration"
# Disabling integration tests that interact with Sift until a better solution is implemented
# - name: Pytest Integration Tests
# env:
# SIFT_GRPC_URI: ${{ vars.SIFT_GRPC_URI }}
# SIFT_REST_URI: ${{ vars.SIFT_REST_URI }}
# SIFT_API_KEY: ${{ secrets.SIFT_API_KEY }}
# run: |
# pytest -m "integration"
- name: Sync Stubs Mypy
working-directory: python/lib
run: |
stubtest \
--mypy-config-file ../pyproject.toml \
sift_client.resources.sync_stubs
python-ci-status:
if: always()
needs: [changes, test-python]
runs-on: ubuntu-latest
steps:
- name: Check result
run: |
result="${{ needs.test-python.result }}"
if [[ "$result" == "success" || "$result" == "skipped" ]]; then
echo "python-ci passed (test-python: $result)"
else
echo "python-ci failed (test-python: $result)"
exit 1
fi