chore: replace black/isort/flake8 by ruff #908
Workflow file for this run
This file contains hidden or 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: Python SDK quality checks and unit tests | |
| on: | |
| push: | |
| paths: | |
| - "openfoodfacts/**" | |
| - "pyproject.toml" | |
| - "poetry.lock" | |
| - "tests/**" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: [3.11] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install Poetry | |
| uses: snok/install-poetry@v1.4 | |
| with: | |
| virtualenvs-create: true | |
| virtualenvs-in-project: true | |
| - name: Load cached venv | |
| id: cached-poetry-dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: .venv | |
| key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }} | |
| - name: Install dependencies | |
| run: poetry install --with=dev --all-extras | |
| if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
| - name: Launch quality checks | |
| run: | | |
| poetry run check . | |
| poetry run mypy . | |
| poetry run isort --check . | |
| - name: Test with pytest | |
| run: | | |
| poetry run pytest tests |