From f97d7143c5e535548e20c1494207f38728f10486 Mon Sep 17 00:00:00 2001 From: scito Date: Fri, 30 Dec 2022 17:49:46 +0100 Subject: [PATCH] ci: fix mypy and pytest-cov after clean --- .github/workflows/ci.yml | 4 ++-- upgrade_deps.sh | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4e51b3a..248ffba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,8 +46,8 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=200 --statistics - name: Type checking with mypy run: | - mypy --install-types --non-interactive src tests - mypy --strict src tests + mypy --install-types --non-interactive src/*.py tests/*.py + mypy --strict src/*.py tests/*.py if: matrix.python-version == '3.x' - name: Test with pytest run: pytest diff --git a/upgrade_deps.sh b/upgrade_deps.sh index dd808db..4615c84 100755 --- a/upgrade_deps.sh +++ b/upgrade_deps.sh @@ -240,13 +240,13 @@ eval "$cmd" # Type checking -cmd="$MYPY --install-types --non-interactive *.py" +cmd="$MYPY --install-types --non-interactive src/*.py tests/*.py" if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi eval "$cmd" # change to src as python -m mypy adds the current dir Python sys.path # execute in a subshell in order not to loose the exit code and not to change the dir in the currrent shell -cmd="(cd src && $MYPY --strict *.py ../tests)" +cmd="$MYPY --strict src/*.py tests/*.py" if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi eval "$cmd" @@ -275,7 +275,7 @@ if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}"; eval "$cmd" COVERAGE_OUT="tests/reports/pytest-coverage.txt" -cmd="pytest --cov=test_extract_otp_secret_keys_pytest --junitxml=tests/reports/pytest.xml --cov-report html:tests/reports/html --cov-report=term-missing tests/ | tee $COVERAGE_OUT" +cmd="mkdir -p tests/reports; pytest --cov=test_extract_otp_secret_keys_pytest --junitxml=tests/reports/pytest.xml --cov-report html:tests/reports/html --cov-report=term-missing tests/ | tee $COVERAGE_OUT" if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi eval "$cmd"