From 90c877a559c0dcee3c596e7ab5af4ab0140ced1e Mon Sep 17 00:00:00 2001 From: ZanSara Date: Thu, 19 Jan 2023 18:12:26 +0100 Subject: [PATCH] bug: `mypy` should ignore files in `test/` (#3894) * exclude files in test/ * verify that the CI ignores test files * dont fail in case of no files --- .github/workflows/tests.yml | 5 ++++- test/conftest.py | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8dc159c41..83d360167 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -93,7 +93,9 @@ jobs: run: | for file in ${{ steps.files.outputs.all_changed_files }}; do if [[ $file == *.py ]]; then - changed_files="$changed_files $file" + if [[ $file != test/* ]]; then + changed_files="$changed_files $file" + fi fi done echo "changed_files=$changed_files" >> $GITHUB_OUTPUT @@ -104,6 +106,7 @@ jobs: pythonVersion: 3.8 # Literals and mypy just don't work well together. - name: Mypy + if: steps.python-files.outputs.changed_files run: | mkdir .mypy_cache/ mypy ${{ steps.python-files.outputs.changed_files }} diff --git a/test/conftest.py b/test/conftest.py index 51d8a0ce0..699daf76b 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -35,7 +35,6 @@ from haystack.document_stores import ( OpenSearchDocumentStore, GraphDBKnowledgeGraph, FAISSDocumentStore, - SQLDocumentStore, ) from haystack.nodes import ( BaseReader,