| 1 |
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions |
| 2 |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions |
| 3 |
|
| 4 |
name: Python package |
| 5 |
|
| 6 |
permissions: |
| 7 |
contents: read |
| 8 |
|
| 9 |
on: |
| 10 |
push: |
| 11 |
branches: [ main, 7.x, 8.x ] |
| 12 |
pull_request: |
| 13 |
branches: [ main, 7.x, 8.x ] |
| 14 |
|
| 15 |
jobs: |
| 16 |
formatting: |
| 17 |
|
| 18 |
runs-on: ubuntu-latest |
| 19 |
timeout-minutes: 5 |
| 20 |
steps: |
| 21 |
- uses: actions/checkout@v6 |
| 22 |
with: |
| 23 |
fetch-depth: 0 |
| 24 |
- name: Set up Python |
| 25 |
uses: actions/setup-python@v6 |
| 26 |
with: |
| 27 |
python-version: 3.x |
| 28 |
cache: pip |
| 29 |
- name: Install uv |
| 30 |
uses: astral-sh/setup-uv@v7 |
| 31 |
- name: Install dependencies |
| 32 |
run: | |
| 33 |
# when changing the versions please update CONTRIBUTING.md too |
| 34 |
uv pip install --system darker==2.1.1 black==24.10.0 |
| 35 |
- name: Lint with darker |
| 36 |
run: | |
| 37 |
# disabling darker for now, I can't get it to format the same locally and on CI. |
| 38 |
# darker -r 60625f241f298b5039cb2debc365db38aa7bb522 --check --diff . || ( |
| 39 |
# echo "Changes need auto-formatting. Run:" |
| 40 |
# echo " darker -r 60625f241f298b5039cb2debc365db38aa7bb522 ." |
| 41 |
# echo "then commit and push changes to fix." |
| 42 |
# exit 1 |
| 43 |
# ) |