Skip to content

Commit 3b72c71

Browse files
committed
Switch linters CI to use pre-commit command line
Using pre-commit-uv for fast installation
1 parent 6e0c5d6 commit 3b72c71

File tree

3 files changed

+12
-26
lines changed

3 files changed

+12
-26
lines changed

.github/workflows/tests.yml

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,31 +43,17 @@ jobs:
4343

4444
linters:
4545
runs-on: ubuntu-latest
46-
4746
steps:
4847
- uses: actions/checkout@v4
49-
- name: Set up Python ${{ matrix.python-version }} with uv
48+
- name: Set up Python 3.10 with uv
5049
uses: drivendataorg/[email protected]
5150
with:
52-
python-version: ${{ matrix.python-version }}
51+
python-version: "3.10"
5352
cache: 'packages'
5453

5554
- name: Install dependencies
5655
run: |
5756
uv sync
58-
- name: Install linter deps
57+
- name: Run pre-commit checks
5958
run: |
60-
uv pip install -r tests/requirements-linters.txt
61-
- name: Run isort
62-
run: |
63-
uv run isort --version
64-
uv run isort -c .
65-
- name: Run flake8
66-
if: failure() || success()
67-
run: |
68-
uv run flake8 --version
69-
uv run flake8
70-
- uses: psf/black@stable
71-
with:
72-
version: "22.3.0"
73-
if: failure() || success()
59+
uv run pre-commit run --all --all-files

.pre-commit-config.yaml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,36 @@ repos:
88
rev: 3.8.4
99
hooks:
1010
- id: flake8
11-
language_version: python3.9
11+
language_version: python3.10
1212
- repo: https://github.com/pre-commit/mirrors-isort
1313
rev: v5.6.4
1414
hooks:
1515
- id: isort
16-
language_version: python3.9
16+
language_version: python3.10
1717
- repo: https://github.com/ikamensh/flynt/
1818
rev: '0.69'
1919
hooks:
2020
- id: flynt
21-
language_version: python3.9
21+
language_version: python3.10
2222
- repo: https://github.com/asottile/pyupgrade
2323
rev: v2.26.0
2424
hooks:
2525
- id: pyupgrade
2626
entry: pyupgrade --py3-plus --py36-plus --py37-plus --keep-runtime-typing
27-
language_version: python3.9
27+
language_version: python3.10
2828
- repo: https://github.com/myint/autoflake
2929
rev: 'v1.4'
3030
hooks:
3131
- id: autoflake
3232
args: ['--remove-all-unused-imports', '-i']
33-
language_version: python3.9
33+
language_version: python3.10
3434
- repo: https://github.com/pre-commit/mirrors-autopep8
3535
rev: 'v1.5.7'
3636
hooks:
3737
- id: autopep8
38-
language_version: python3.9
38+
language_version: python3.10
3939
- repo: https://github.com/psf/black
4040
rev: 22.3.0
4141
hooks:
4242
- id: black
43-
language_version: python3
44-
language_version: python3.9
43+
language_version: python3.10

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ dev = [
4848
"tox-uv>=1.20.1",
4949
"tox>=4.24.1",
5050
"pytest-cov>=6.0.0",
51+
"pre-commit-uv>=4.1.4",
5152
]
5253

5354
[tool.setuptools]

0 commit comments

Comments
 (0)