Skip to content

Commit

Permalink
Update CI test and scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
duydq12 committed Jan 31, 2024
1 parent 24de8a5 commit 50a8ae9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install typing_extensions flake8 pytest
pip install typing_extensions isort black flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# exit-zero treats all errors as warnings.
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=120 --statistics --ignore W503
black . --check --target-version=py310 --line-length=120
isort . --check-only --profile=black --lbt=1 -l=120
- name: Test with pytest
run: |
# install local module
pip install .
# test with Pytest
pytest
pytest
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ count = true
max-complexity = 10
max-line-length = 120
statistics = true
ignore = ["W503"]


[tool.black]
Expand Down
2 changes: 1 addition & 1 deletion scripts/install-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -eux

pip install black flake8 pytest
pip install typing_extensions isort black flake8 pytest

if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
9 changes: 5 additions & 4 deletions scripts/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

set -eux

# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings.
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=120 --statistics --ignore W503

# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
black . --check --target-version=py310 --line-length=120

isort . --check-only --profile=black --lbt=1 -l=120

0 comments on commit 50a8ae9

Please sign in to comment.