|
7 | 7 | branches: main |
8 | 8 |
|
9 | 9 | jobs: |
10 | | - flake8: |
| 10 | + ruff: |
11 | 11 | runs-on: ${{ matrix.os }} |
12 | 12 | strategy: |
13 | 13 | matrix: |
14 | 14 | os: [ubuntu-latest] |
15 | | - python: [3.8] |
| 15 | + python: [3.9] |
16 | 16 | steps: |
17 | | - - uses: actions/checkout@v2 |
18 | | - - name: Set up Python |
19 | | - uses: actions/setup-python@v1 |
| 17 | + - uses: actions/checkout@v4 |
| 18 | + - uses: actions/setup-python@v5 |
20 | 19 | with: |
21 | 20 | python-version: ${{ matrix.python }} |
22 | 21 | architecture: x64 |
23 | | - - name: Run flake8 |
24 | | - run: | |
25 | | - pip install flake8 |
26 | | - flake8 --version |
27 | | - flake8 |
28 | | -
|
29 | | - isort: |
30 | | - runs-on: ${{ matrix.os }} |
31 | | - strategy: |
32 | | - matrix: |
33 | | - os: [ubuntu-latest] |
34 | | - python: [3.8] |
35 | | - steps: |
36 | | - - uses: actions/checkout@v2 |
37 | | - - name: Set up Python |
38 | | - uses: actions/setup-python@v1 |
| 22 | + - uses: abatilo/actions-poetry@v3 |
39 | 23 | with: |
40 | | - python-version: ${{ matrix.python }} |
41 | | - architecture: x64 |
42 | | - - name: Run isort |
| 24 | + poetry-version: "1.8.2" |
| 25 | + - name: Resolve dependencies |
| 26 | + run: poetry export -f requirements.txt --without-hashes --only quality --output requirements.txt |
| 27 | + - name: Install dependencies |
| 28 | + run: | |
| 29 | + python -m pip install --upgrade uv |
| 30 | + uv pip install --system -r requirements.txt |
| 31 | + - name: Run ruff |
43 | 32 | run: | |
44 | | - pip install isort |
45 | | - isort --version |
46 | | - isort . |
47 | | - if [ -n "$(git status --porcelain --untracked-files=no)" ]; then exit 1; else echo "All clear"; fi |
| 33 | + ruff --version |
| 34 | + ruff check --diff . |
48 | 35 |
|
49 | 36 | mypy: |
50 | 37 | runs-on: ${{ matrix.os }} |
51 | 38 | strategy: |
52 | 39 | matrix: |
53 | 40 | os: [ubuntu-latest] |
54 | | - python: [3.8] |
| 41 | + python: [3.9] |
55 | 42 | steps: |
56 | | - - uses: actions/checkout@v2 |
57 | | - - name: Set up Python |
58 | | - uses: actions/setup-python@v1 |
| 43 | + - uses: actions/checkout@v4 |
| 44 | + - uses: actions/setup-python@v5 |
59 | 45 | with: |
60 | 46 | python-version: ${{ matrix.python }} |
61 | 47 | architecture: x64 |
| 48 | + - uses: abatilo/actions-poetry@v3 |
| 49 | + with: |
| 50 | + poetry-version: "1.8.2" |
| 51 | + - name: Resolve dependencies |
| 52 | + run: poetry export -f requirements.txt --without-hashes --with quality --output requirements.txt |
| 53 | + - name: Install dependencies |
| 54 | + run: | |
| 55 | + python -m pip install --upgrade uv |
| 56 | + uv pip install --system -r requirements.txt |
62 | 57 | - name: Run mypy |
63 | 58 | run: | |
64 | | - pip install mypy |
65 | 59 | mypy --version |
66 | 60 | mypy |
67 | 61 |
|
68 | | - black: |
| 62 | + ruff-format: |
69 | 63 | runs-on: ${{ matrix.os }} |
70 | 64 | strategy: |
71 | 65 | matrix: |
72 | 66 | os: [ubuntu-latest] |
73 | | - python: [3.8] |
| 67 | + python: [3.9] |
74 | 68 | steps: |
75 | | - - uses: actions/checkout@v2 |
76 | | - - name: Set up Python |
77 | | - uses: actions/setup-python@v2 |
| 69 | + - uses: actions/checkout@v4 |
| 70 | + - uses: actions/setup-python@v5 |
78 | 71 | with: |
79 | 72 | python-version: ${{ matrix.python }} |
80 | 73 | architecture: x64 |
81 | | - - name: Run black |
| 74 | + - uses: abatilo/actions-poetry@v3 |
| 75 | + with: |
| 76 | + poetry-version: "1.8.2" |
| 77 | + - name: Resolve dependencies |
| 78 | + run: poetry export -f requirements.txt --without-hashes --only quality --output requirements.txt |
| 79 | + - name: Install dependencies |
| 80 | + run: | |
| 81 | + python -m pip install --upgrade uv |
| 82 | + uv pip install --system -r requirements.txt |
| 83 | + - name: Run ruff |
82 | 84 | run: | |
83 | | - pip install black |
84 | | - black --version |
85 | | - black --check --diff . |
| 85 | + ruff --version |
| 86 | + ruff format --check --diff . |
86 | 87 |
|
87 | | - bandit: |
| 88 | + precommit-hooks: |
88 | 89 | runs-on: ${{ matrix.os }} |
89 | 90 | strategy: |
90 | 91 | matrix: |
91 | 92 | os: [ubuntu-latest] |
92 | | - python: [3.8] |
| 93 | + python: [3.9] |
93 | 94 | steps: |
94 | | - - uses: actions/checkout@v2 |
95 | | - - name: Set up Python |
96 | | - uses: actions/setup-python@v2 |
| 95 | + - uses: actions/checkout@v4 |
| 96 | + - uses: actions/setup-python@v5 |
97 | 97 | with: |
98 | 98 | python-version: ${{ matrix.python }} |
99 | 99 | architecture: x64 |
100 | | - - name: Run bandit |
| 100 | + - uses: abatilo/actions-poetry@v3 |
| 101 | + with: |
| 102 | + poetry-version: "1.8.2" |
| 103 | + - name: Resolve dependencies |
| 104 | + run: poetry export -f requirements.txt --without-hashes --only quality --output requirements.txt |
| 105 | + - name: Install dependencies |
| 106 | + run: | |
| 107 | + python -m pip install --upgrade uv |
| 108 | + uv pip install --system -r requirements.txt |
| 109 | + - name: Run pre-commit hooks |
101 | 110 | run: | |
102 | | - pip install bandit[toml] |
103 | | - bandit --version |
104 | | - bandit -r . -c pyproject.toml |
| 111 | + git checkout -b temp |
| 112 | + pre-commit install |
| 113 | + pre-commit --version |
| 114 | + pre-commit run --all-files |
0 commit comments