|
1 | | -name: Linting |
| 1 | +name: Python linting |
2 | 2 |
|
3 | 3 | # Build on every branch push, tag push, and pull request change: |
4 | 4 | on: [push, pull_request] |
5 | 5 |
|
6 | 6 | jobs: |
7 | 7 | mypy: |
8 | 8 | name: mypy |
9 | | - runs-on: ubuntu-latest |
| 9 | + runs-on: ubuntu-22.04 |
| 10 | + strategy: |
| 11 | + fail-fast: false |
| 12 | + matrix: |
| 13 | + py_version: |
| 14 | + - '3.8' |
| 15 | + |
10 | 16 | steps: |
11 | 17 | - name: Checkout reposistory |
12 | 18 | uses: actions/checkout@main |
13 | 19 |
|
14 | | - - name: Set up Python 3.9 |
| 20 | + - name: Set up Python ${{ matrix.py_version }} |
15 | 21 | uses: actions/setup-python@main |
16 | 22 | with: |
17 | | - python-version: 3.9 |
| 23 | + python-version: ${{ matrix.py_version }} |
| 24 | + |
| 25 | + - name: Install uv |
| 26 | + uses: astral-sh/setup-uv@v7 |
18 | 27 |
|
| 28 | + # Setup venv and install dependencies without building the project from source. |
19 | 29 | - name: Install Dependencies |
20 | 30 | run: | |
21 | | - python3 -m pip install -r requirements.txt |
22 | | - python3 -m pip install -U maturin |
23 | | - python3 -m pip install -U mypy |
| 31 | + uv venv --no-project --python ${{ matrix.py_version }} |
| 32 | + uv sync --no-install-project |
| 33 | + uv pip install -U mypy |
24 | 34 |
|
25 | 35 | - name: mypy |
26 | | - run: mypy --show-column-numbers --hide-error-context . |
| 36 | + run: | |
| 37 | + uv run --no-sync mypy --show-column-numbers --hide-error-context . |
27 | 38 |
|
28 | 39 | ruff: |
29 | | - runs-on: ubuntu-latest |
30 | 40 | name: ruff |
| 41 | + runs-on: ubuntu-22.04 |
| 42 | + strategy: |
| 43 | + fail-fast: false |
| 44 | + matrix: |
| 45 | + py_version: |
| 46 | + - '3.8' |
| 47 | + |
31 | 48 | steps: |
32 | 49 | - name: Checkout repository |
33 | 50 | uses: actions/checkout@main |
34 | 51 |
|
35 | | - - name: Set up Python 3.9 |
| 52 | + - name: Set up Python ${{ matrix.py_version }} |
36 | 53 | uses: actions/setup-python@main |
37 | 54 | with: |
38 | | - python-version: '3.9' |
| 55 | + python-version: ${{ matrix.py_version }} |
39 | 56 |
|
40 | | - - name: Setup venv |
41 | | - run: | |
42 | | - python3 -m venv .venv |
43 | | -
|
44 | | - - name: Install Dependencies |
45 | | - run: | |
46 | | - . .venv/bin/activate |
47 | | - python3 -m pip install -U -r requirements.txt |
48 | | - python3 -m pip install -U ruff |
| 57 | + - name: Install uv |
| 58 | + uses: astral-sh/setup-uv@v7 |
49 | 59 |
|
50 | | - - name: mypy |
| 60 | + - name: ruff |
51 | 61 | run: | |
52 | | - . .venv/bin/activate |
53 | | - ruff check |
| 62 | + uvx ruff check src/ |
54 | 63 |
|
55 | 64 | ruff_format: |
56 | 65 | name: ruff format |
57 | | - runs-on: ubuntu-latest |
| 66 | + runs-on: ubuntu-22.04 |
| 67 | + strategy: |
| 68 | + fail-fast: false |
| 69 | + matrix: |
| 70 | + py_version: |
| 71 | + - '3.8' |
| 72 | + |
58 | 73 | steps: |
59 | 74 | - name: Checkout repository |
60 | 75 | uses: actions/checkout@main |
61 | 76 |
|
62 | | - - name: Set up Python 3.9 |
| 77 | + - name: Set up Python ${{ matrix.py_version }} |
63 | 78 | uses: actions/setup-python@main |
64 | 79 | with: |
65 | | - python-version: 3.9 |
| 80 | + python-version: ${{ matrix.py_version }} |
66 | 81 |
|
67 | | - - name: Setup venv |
68 | | - run: | |
69 | | - python3 -m venv .venv |
| 82 | + - name: Install uv |
| 83 | + uses: astral-sh/setup-uv@v7 |
70 | 84 |
|
71 | | - - name: Install dependencies |
72 | | - run: | |
73 | | - . .venv/bin/activate |
74 | | - python3 -m pip install -U ruff |
75 | | -
|
76 | | - - name: mypy |
| 85 | + - name: ruff |
77 | 86 | run: | |
78 | | - . .venv/bin/activate |
79 | | - ruff format src/ --check |
| 87 | + uvx ruff format src/ --check |
0 commit comments