Skip to content

fix(align): remove +1 from char range in offset mapping (explosion/sp… #185

fix(align): remove +1 from char range in offset mapping (explosion/sp…

fix(align): remove +1 from char range in offset mapping (explosion/sp… #185

Workflow file for this run

name: tests
on:
push:
paths-ignore:
- "*.md"
pull_request:
types: [opened, synchronize, reopened, edited]
paths-ignore:
- "*.md"
permissions:
contents: read
# When this workflow is queued, automatically cancel any previous running
# or pending jobs from the same branch
concurrency:
group: tests-${{ github.ref }}
cancel-in-progress: true
env:
MODULE_NAME: "spacy_transformers"
RUN_PYRIGHT: "true"
jobs:
tests:
name: Test
if: github.repository_owner == 'explosion'
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python_version: ["3.12"]
include:
- os: macos-latest
python_version: "3.11"
- os: windows-latest
python_version: "3.11"
- os: ubuntu-latest
python_version: "3.12"
- os: windows-latest
python_version: "3.12"
runs-on: ${{ matrix.os }}
steps:
- name: Check out repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Configure Python version
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: ${{ matrix.python_version }}
- name: Install dependencies
run: |
python -m pip install -U build pip setuptools wheel
python -m pip install -r requirements.txt --force-reinstall
- name: Build sdist
run: |
python -m build --sdist
- name: Run pyright
if: env.RUN_PYRIGHT == 'true'
shell: bash
run: |
python -m pyright $MODULE_NAME
- name: Delete source directory
shell: bash
run: |
rm -rf $MODULE_NAME
- name: Uninstall all packages
run: |
python -m pip freeze --exclude pywin32 --exclude torch
python -m pip freeze --exclude pywin32 --exclude torch > installed.txt
python -m pip uninstall -y -r installed.txt
- name: Install newest torch
run: |
python -m pip install torch --index-url https://download.pytorch.org/whl/cpu --force-reinstall
- name: Install from sdist
shell: bash
run: |
SDIST=$(python -c "import os;print(os.listdir('./dist')[-1])" 2>&1)
python -m pip install dist/$SDIST
- name: Run tests
shell: bash
run: |
python -m pip install -r requirements.txt --force-reinstall
python -m pytest --pyargs $MODULE_NAME --cov=$MODULE_NAME