fix flake8 #7
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Dev CI | |
on: | |
push: | |
branches: | |
# on all branches except main where full build will be run | |
- '*' | |
- '!main' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.9", "3.10"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Build package | |
run: | | |
python -m venv dgcv_venv | |
source dgcv_venv/bin/activate | |
python -m pip install --upgrade pip build setuptools wheel | |
python -m pip install --upgrade flake8 pytest pytest-cov | |
python -m build --wheel | |
deactivate | |
# - name: Type checking | |
# run: mypy -p dgcv | |
# Pending to be added in the near future: | |
# * flake8 src --count --exit-zero --max-complexity=10 --statistics | |
- name: Linting with flake8 | |
run: | | |
source dgcv_venv/bin/activate | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 src --count --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 99 chars wide | |
flake8 src --count --exit-zero --statistics | |
deactivate | |
- name: Run tests | |
run: | | |
source dgcv_venv/bin/activate | |
pip install dist/*.whl | |
pytest tests | |
deactivate | |
- name: Generate coverage | |
run: | | |
source dgcv_venv/bin/activate | |
pip install dist/*.whl | |
pytest --cov=. --cov-report=xml tests | |
deactivate |