Skip to content

Commit b58ee79

Browse files
committed
Fix CI workflow for Python linting
The workflow was broken by the Python version it was using no longer being available from the actions/setup-python action. Rather than continuing in this fashion, it seems better to use the same setup script as is used by the action and unit tests. This will ensure everything is done under the same environment.
1 parent dfba7a8 commit b58ee79

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

.github/workflows/lint-python.yml

+11-7
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,23 @@ jobs:
3232
- name: Checkout
3333
uses: actions/checkout@v2
3434

35-
- name: Set up Python
36-
uses: actions/setup-python@v1
37-
with:
38-
python-version: '3.8.6'
35+
- name: Run the set up script
36+
id: setup
37+
run: |
38+
"${{ github.workspace }}/action-setup.sh"
3939
4040
- name: Install flake8
4141
run: |
42-
python -m pip install --upgrade pip
43-
pip install --quiet flake8
44-
pip install --quiet pep8-naming
42+
source "${{ steps.setup.outputs.python-venv-activate-script-path }}"
43+
"${{ steps.setup.outputs.python-command }}" \
44+
-m \
45+
pip install \
46+
flake8 \
47+
pep8-naming
4548
4649
- name: Lint with flake8
4750
env:
4851
PYTHON_PROJECT_PATH: ${GITHUB_WORKSPACE}/compilesketches
4952
run: |
53+
source "${{ steps.setup.outputs.python-venv-activate-script-path }}"
5054
flake8 --config "${{ env.PYTHON_PROJECT_PATH }}/.flake8" --show-source "${{ env.PYTHON_PROJECT_PATH }}"

compilesketches/.flake8

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[flake8]
22
doctests = True
3+
extend-exclude = .venv
34
# W503 and W504 are mutually exclusive. PEP 8 recommends line break before.
45
ignore = W503
56
max-complexity = 10

0 commit comments

Comments
 (0)