Skip to content

Commit 833627b

Browse files
committed
Adjusted lint_python workflow
Upgraded flake8 to 7.1
1 parent 75c27bf commit 833627b

File tree

2 files changed

+30
-12
lines changed

2 files changed

+30
-12
lines changed

.github/workflows/lint_python.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,24 @@ jobs:
77
- uses: actions/checkout@v3
88
- uses: actions/setup-python@v4
99
with:
10-
python-version: 3.x
11-
- shell: bash
12-
name: Lint and test
13-
run: ./lint.sh
10+
python-version: 3.12
11+
- name: Install dependencies
12+
run: |
13+
python -m pip install --upgrade pip
14+
pip install -r requirements-dev.txt
15+
- name: Lint with flake8
16+
run: flake8 ./patterns --count --show-source --statistics
17+
- name: Format check with isort and black
18+
run: |
19+
isort --profile black --check ./patterns
20+
black --check ./patterns
21+
- name: Type check with mypy
22+
run: mypy --ignore-missing-imports ./patterns || true
23+
- name: Run tests with pytest
24+
run: |
25+
pytest ./patterns
26+
pytest --doctest-modules ./patterns || true
27+
- name: Check Python version compatibility
28+
run: shopt -s globstar && pyupgrade --py312-plus ./patterns/**/*.py
29+
- name: Run tox
30+
run: tox

requirements-dev.txt

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
-e .
2-
3-
pytest~=6.2.0
4-
pytest-cov~=2.11.0
5-
pytest-randomly~=3.1.0
6-
black>=20.8b1
7-
isort~=5.7.0
8-
flake8~=3.8.0
1+
mypy
2+
pyupgrade
3+
pytest>=6.2.0
4+
pytest-cov>=2.11.0
5+
pytest-randomly>=3.1.0
6+
black>=25.1.0
7+
isort>=5.7.0
8+
flake8>=7.1.0
9+
tox>=4.25.0

0 commit comments

Comments
 (0)