chore(deps): bump ruff from 0.3.4 to 0.4.4 in /bindings/python #78
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Python bindings | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
env: | |
RUST_BACKTRACE: full | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref_name }} | |
cancel-in-progress: true | |
jobs: | |
lint-python: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install rust stable | |
uses: dtolnay/rust-toolchain@stable | |
- name: Cache rust | |
uses: Swatinem/rust-cache@v2 | |
with: | |
key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.toml') }} | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
cache: 'pip' | |
- name: Update pip | |
run: python -m pip install --upgrade pip | |
- name: Build and install package | |
run: make build-python PYTHON_INTERPRETER=python | |
- name: Run linters | |
run: make lint-python PYTHON_INTERPRETER=python | |
external-build-python: | |
uses: ./.github/workflows/reusable-build-python.yml | |
with: | |
WORKING_DIRECTORY: "bindings/python" | |
secrets: inherit | |
test-python: | |
needs: [external-build-python] | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, macos-latest, macos-14, windows-latest ] # at the moment macos-14 is exclusive M1 chip | |
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | |
# macos-14 not supporting 3.8 and 3.9 | |
exclude: | |
- python-version: 3.8 | |
os: macos-14 | |
- python-version: 3.9 | |
os: macos-14 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: false | |
- name: Install rust stable | |
uses: dtolnay/rust-toolchain@stable | |
- name: Cache rust | |
uses: Swatinem/rust-cache@v2 | |
with: | |
key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.toml') }} | |
- uses: actions/download-artifact@v4 | |
with: | |
# for macos-14 get macos-latest artifacts | |
pattern: wheels-${{ matrix.os == 'macos-14' && 'macos-latest' || matrix.os }}-* | |
merge-multiple: true | |
path: dist | |
- name: Show dist files | |
shell: bash | |
run: ls -lah ./dist | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- name: Test installation from source (editable mode) # also will populate the fast_aug module with so file | |
shell: bash | |
run: | | |
make build-python PYTHON_INTERPRETER=python | |
- name: Run python and rust tests (install from dist) | |
shell: bash | |
run: | | |
if [[ "${{ runner.os }}" == "Windows" ]]; then | |
DIST_PATH="$(cygpath -u "${{ github.workspace }}")/dist" | |
else | |
DIST_PATH="${{ github.workspace }}/dist" | |
fi | |
make test-python PYTHON_INTERPRETER=python PYTHON_INSTALL_FROM_DIST=$DIST_PATH | |
test-profile-python: | |
runs-on: macos-latest # not working on linux, kernel virtualization blocked | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: false | |
- name: Install rust stable | |
uses: dtolnay/rust-toolchain@stable | |
- name: Cache rust | |
uses: Swatinem/rust-cache@v2 | |
with: | |
key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.toml') }} | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
cache: 'pip' | |
- name: Update pip | |
run: python -m pip install --upgrade pip | |
- name: Run profiling in release mode | |
run: sudo make profile-python PYTHON_INTERPRETER=python | |
- name: Upload profiling results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: python-profiling-results | |
path: | | |
# benchmarking results and flamegraph | |
bindings/python/flamegraph*.svg | |
bindings/python/python-bench*.svg | |
if-no-files-found: error | |
test-compare-python: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: false | |
- name: Install rust stable | |
uses: dtolnay/rust-toolchain@stable | |
- name: Cache rust | |
uses: Swatinem/rust-cache@v2 | |
with: | |
key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.toml') }} | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
cache: 'pip' | |
- name: Update pip | |
run: python -m pip install --upgrade pip | |
- name: Build and install spaCy | |
run: python -m pip install spacy && python -m spacy download en_core_web_sm | |
- name: Run comparison (just to check that it works) | |
run: make compare-python PYTHON_INTERPRETER=python PYTHON_COMPARE_REPETITIONS=1 |