Skip to content

Commit 6283516

Browse files
authored
Update linters and python version for linting in CI (#15200)
x-ref: #15197
1 parent d671b31 commit 6283516

File tree

6 files changed

+15
-9
lines changed

6 files changed

+15
-9
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797
# but it's useful to run them with tox too,
9898
# to ensure the tox env works as expected
9999
- name: Formatting with Black + isort and code style with flake8
100-
python: '3.7'
100+
python: '3.10'
101101
arch: x64
102102
os: ubuntu-latest
103103
toxenv: lint

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ repos:
44
hooks:
55
- id: black
66
- repo: https://github.com/pycqa/isort
7-
rev: 5.11.5 # must match test-requirements.txt (cannot use version 5.12 until python 3.7 support is dropped)
7+
rev: 5.12.0 # must match test-requirements.txt
88
hooks:
99
- id: isort
1010
- repo: https://github.com/pycqa/flake8
11-
rev: 5.0.4 # must match test-requirements.txt (cannot use version 6 until python 3.7 support is dropped)
11+
rev: 6.0.0 # must match test-requirements.txt
1212
hooks:
1313
- id: flake8
1414
additional_dependencies:
15-
- flake8-bugbear==22.12.6 # must match test-requirements.txt
16-
- flake8-noqa==1.3.0 # must match test-requirements.txt
15+
- flake8-bugbear==23.3.23 # must match test-requirements.txt
16+
- flake8-noqa==1.3.1 # must match test-requirements.txt
1717

1818
ci:
1919
# We run flake8 as part of our GitHub Actions suite in CI

CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ python3 -m pip install -e .
4444
hash -r # This resets shell PATH cache, not necessary on Windows
4545
```
4646

47+
> **Note**
48+
> You'll need Python 3.8 or higher to install all requirements listed in
49+
> test-requirements.txt
50+
4751
### Running tests
4852

4953
Running the full test suite can take a while, and usually isn't necessary when

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ force-exclude = '''
2828
'''
2929

3030
[tool.isort]
31+
py_version = 37
3132
profile = "black"
3233
line_length = 99
3334
combine_as_imports = true

test-requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
attrs>=18.0
44
black==23.3.0 # must match version in .pre-commit-config.yaml
55
filelock>=3.3.0
6-
flake8==5.0.4 # must match version in .pre-commit-config.yaml
7-
flake8-bugbear==22.12.6 # must match version in .pre-commit-config.yaml
8-
flake8-noqa==1.3.0 # must match version in .pre-commit-config.yaml
9-
isort[colors]==5.11.5 # must match version in .pre-commit-config.yaml
6+
flake8==6.0.0; python_version >= "3.8" # must match version in .pre-commit-config.yaml
7+
flake8-bugbear==23.3.23; python_version >= "3.8" # must match version in .pre-commit-config.yaml
8+
flake8-noqa==1.3.1; python_version >= "3.8" # must match version in .pre-commit-config.yaml
9+
isort[colors]==5.12.0; python_version >= "3.8" # must match version in .pre-commit-config.yaml
1010
lxml>=4.9.1; (python_version<'3.11' or sys_platform!='win32') and python_version<'3.12'
1111
psutil>=4.0
1212
# pytest 6.2.3 does not support Python 3.10

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ commands =
4040

4141
[testenv:lint]
4242
description = check the code style
43+
skip_install = true
4344
commands =
4445
flake8 {posargs}
4546
black --check --diff --color .

0 commit comments

Comments
 (0)