[poetry] Bump ruff from 0.0.278 to 0.2.1 #119
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: Run python tests for hook script. | |
on: | |
workflow_call: | |
workflow_dispatch: | |
push: | |
paths: | |
- "**.py" | |
- "pyproject.toml" | |
- ".github/workflows/tests.yaml" | |
- ".github/actions/**" | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
generate_test_matrix: | |
runs-on: ubuntu-latest | |
outputs: | |
include: ${{ steps.set-matrix.outputs.include }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: Extract extras from `pyproject.toml` | |
id: set-matrix | |
shell: python | |
run: | | |
import tomllib | |
import os | |
import json | |
from itertools import product | |
with open('pyproject.toml', 'rb') as f: | |
manifest = tomllib.load(f) | |
extras = [''] + list(manifest['tool']['poetry']['extras']) | |
platforms = ['ubuntu-latest', 'macos-latest','windows-latest'] | |
python = '3.7' | |
yaml = [ {'os': o,'python-version': p, 'extras': e} for o, p, e in product(platforms, [python], extras)] | |
out = json.dumps(yaml) | |
print(out) | |
with open(os.environ['GITHUB_OUTPUT'], 'a') as f: | |
f.write('include=' + out) | |
test: | |
name: test ${{ matrix.extras && 'with' || '' }} ${{ matrix.extras }} on ${{ matrix.python-version }}, ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
needs: generate_test_matrix | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] | |
extras: ["", "pre-commit"] | |
include: ${{ fromJson(needs.generate_test_matrix.outputs.include) }} | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup | |
id: setup | |
uses: ./.github/actions/setup | |
with: | |
python-version: ${{ matrix.python-version }} | |
install-options: --without lint ${{ matrix.extras && format('--extras "{0}"', matrix.extras) || '' }} --sync | |
- name: Run Tests | |
run: make test |