forked from ipython/ipython
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (38 loc) · 1.36 KB
/
Copy pathpython-package.yml
File metadata and controls
43 lines (38 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python package
permissions:
contents: read
on:
push:
branches: [ main, 7.x, 8.x ]
pull_request:
branches: [ main, 7.x, 8.x ]
jobs:
formatting:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: 3.x
cache: pip
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
- name: Install dependencies
run: |
# when changing the versions please update CONTRIBUTING.md too
uv pip install --system darker==3.0.0 ruff
- name: Lint with darker
run: |
darker --formatter=ruff -r f51c0b1b6b8e48e228a4eaf62dda382f7e4ba0da --check --diff . || (
echo "Changes need auto-formatting. Run:"
echo " darker --formatter=ruff -r f51c0b1b6b8e48e228a4eaf62dda382f7e4ba0da ."
echo "then commit and push changes to fix."
exit 1
)