Skip to content

Commit

Permalink
fix: Bump pre-commit hooks to fix isort issue
Browse files Browse the repository at this point in the history
CI is broken on main due to this isort issue, the root cause lies in an
underlying incompatible change in Poetry. The new version of isort has
dropped support for Python 3.7 so we bump CI to run on 3.11 instead (3.7
is EOL later this year anyway).

PyCQA/isort#2083

With the upgrade to flake8 6, we ran into an issue with comments in the
configuration file. Those comments are moved to their own lines above
the config instead, see issue below.

PyCQA/flake8#1756

Because of installation issues in the lint step, installation is altered
to only installed pre-commit which handles its own dependencies anyway.
  • Loading branch information
aiven-anton committed Jan 30, 2023
1 parent 765ccd9 commit edf860a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
12 changes: 8 additions & 4 deletions .flake8
Expand Up @@ -3,8 +3,12 @@ max-line-length = 125

# E203,W503: incompatibilities with black
# E722: also signaled by pylint (disabling here globally and on case-by-case basis with pylint)
# E501: line length
# E203: whitespace before ':'
# W503: line break before binary operator
# E722: do not use bare 'except'
ignore =
E501, # line length
E203, # whitespace before ':'
W503, # line break before binary operator
E722, # do not use bare 'except'
E501,
E203,
W503,
E722,
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Expand Up @@ -13,13 +13,13 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up Python 3.7
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: 3.11

- name: Install dependencies
run: pip install -r requirements-dev.txt
run: pip install 'pre-commit>=2.2.0'

# required for pylint
- name: Generate version.py
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Expand Up @@ -2,7 +2,7 @@
minimum_pre_commit_version: 2.9.2
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.4.0
hooks:
- id: trailing-whitespace
exclude: ^vendor/|^tests/.*/fixtures/.*|^tests/integration/test_data/.*
Expand All @@ -11,18 +11,18 @@ repos:
- id: debug-statements

- repo: https://github.com/PyCQA/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort
name: isort (python)

- repo: https://github.com/psf/black
rev: 22.3.0
rev: 22.12.0
hooks:
- id: black

- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
rev: 6.0.0
hooks:
- id: flake8

Expand Down

0 comments on commit edf860a

Please sign in to comment.