Skip to content

Commit 7cdb6a0

Browse files
Fix: Integrate flake8 linting into tox for CI
- Added a new [testenv:lint] environment to tox.ini to manage flake8 execution. - Modified the GitHub Actions workflow (.github/workflows/testing.yml) to: - Run `tox -e lint` for the linting stage. - Condition the linting step to run only on Python 3.10 to save CI resources. - This resolves the "flake8: command not found" error in the CI by ensuring flake8 is installed and run within a tox-managed environment. Co-authored-by: xethorn <1835927+xethorn@users.noreply.github.com>
1 parent d8a1463 commit 7cdb6a0

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

.github/workflows/testing.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ jobs:
2323
run: |
2424
python -m pip install --upgrade pip
2525
pip install tox
26-
- name: Lint with flake8
27-
run: |
28-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
29-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
26+
- name: Lint with tox
27+
if: matrix.python-version == '3.10'
28+
run: tox -e lint
3029
- name: Test with tox
3130
env:
3231
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

docs/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ see the `example`_ directory in the repository.
3838
self.create_order_activity,
3939
input={'item': item})
4040
total += activity.result.get('price')
41-
41+
4242
pay_activity = schedule(
4343
'pay', self.create_payment_activity,
4444
input={'total': total})
4545
4646
get_order = schedule('get_order', self.create_get_order_activity)
47-
47+
4848
# Waiting for paying and getting the order to complete before
4949
# we let the user leave the coffee shop.
5050
pay_activity.wait(), get_order.wait()

tox.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,9 @@ commands = py.test
77

88
[testenv:py3]
99
deps = -rrequirements.txt
10+
11+
[testenv:lint]
12+
deps = flake8
13+
commands =
14+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
15+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

0 commit comments

Comments
 (0)