Skip to content

Fix ruff linting issues: remove unused imports and rename unused loop… #6

Fix ruff linting issues: remove unused imports and rename unused loop…

Fix ruff linting issues: remove unused imports and rename unused loop… #6

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip packages
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache spaCy model
id: cache-spacy-model
uses: actions/cache@v4
with:
path: ~/spacy_data
key: ${{ runner.os }}-spacy-en_core_web_sm-3.5.0
restore-keys: |
${{ runner.os }}-spacy-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Download spaCy model
if: steps.cache-spacy-model.outputs.cache-hit != 'true'
run: |
python -m spacy download en_core_web_sm
mkdir -p $HOME/spacy_data
python -c "import spacy; nlp = spacy.load('en_core_web_sm'); nlp.to_disk('$HOME/spacy_data/en_core_web_sm')"
- name: Link cached spaCy model
if: steps.cache-spacy-model.outputs.cache-hit == 'true'
run: |
python -m spacy link $HOME/spacy_data/en_core_web_sm en_core_web_sm --force
- name: Run Black check
run: |
black --check --diff triplet_extract/ tests/ examples/
- name: Run ruff check
run: |
ruff check triplet_extract/ tests/ examples/
- name: Run tests
run: |
pytest tests/ -v