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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: 3.x
cache: pip
- name: Install uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
- 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
)