From b551abb9e4af6bc6c2c446bb54f2388bed7e1d64 Mon Sep 17 00:00:00 2001 From: Nikolas De Giorgis Date: Thu, 4 Feb 2021 22:07:12 +0100 Subject: [PATCH 01/12] moved mypy to github actions --- .evergreen.yml | 21 --------------------- .github/workflows/code_health.yml | 8 ++++++++ mypy.ini | 8 ++++++++ scripts/ci/run_mypy_check.sh | 5 ----- 4 files changed, 16 insertions(+), 26 deletions(-) create mode 100644 mypy.ini delete mode 100755 scripts/ci/run_mypy_check.sh diff --git a/.evergreen.yml b/.evergreen.yml index 184c5eaa5..9f44aa66f 100644 --- a/.evergreen.yml +++ b/.evergreen.yml @@ -102,13 +102,6 @@ functions: - clusterwide binary: scripts/ci/run_test.sh - mypy_linting_test: - - command: subprocess.exec - type: test - params: - working_dir: mongodb-kubernetes-operator - binary: scripts/ci/run_mypy_check.sh - build_and_push_image: - command: subprocess.exec @@ -204,13 +197,6 @@ tasks: image_type: versionhook expire_after: 48h - - name: mypy_linting - commands: - - func: clone - - func: setup_virtualenv - - func: mypy_linting_test - - - name: e2e_test_feature_compatibility_version commands: - func: run_e2e_test @@ -350,13 +336,6 @@ buildvariants: tasks: - name: e2e_test_group - - name: code_health - display_name: code_health - run_on: - - ubuntu1604-build - tasks: - - name: mypy_linting - - name: init_test_run display_name: init_test_run run_on: diff --git a/.github/workflows/code_health.yml b/.github/workflows/code_health.yml index 12c146574..5748f52fe 100644 --- a/.github/workflows/code_health.yml +++ b/.github/workflows/code_health.yml @@ -11,3 +11,11 @@ jobs: - name: Black Check uses: jpetrucciani/black-check@20.8b1 + + Mypy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: MyPy + uses: jpetrucciani/mypy-check@master diff --git a/mypy.ini b/mypy.ini new file mode 100644 index 000000000..778152178 --- /dev/null +++ b/mypy.ini @@ -0,0 +1,8 @@ +# Global options: + +[mypy] +python_version = 3.7 +ignore_missing_imports = true +disallow_untyped_calls = true +disallow_untyped_defs = true +disallow_incomplete_defs = true \ No newline at end of file diff --git a/scripts/ci/run_mypy_check.sh b/scripts/ci/run_mypy_check.sh deleted file mode 100755 index e5a4ae003..000000000 --- a/scripts/ci/run_mypy_check.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -# shellcheck disable=SC1091 -. venv/bin/activate -find . -type f -not -path '*venv*' -name '*.py' -exec python3 -m mypy --disallow-untyped-calls --disallow-untyped-defs --disallow-incomplete-defs --ignore-missing-imports {} + From 4f5c1d278bf27a96c889719efc13c44f5ebc160d Mon Sep 17 00:00:00 2001 From: Nikolas De Giorgis Date: Thu, 4 Feb 2021 22:08:30 +0100 Subject: [PATCH 02/12] temporary test --- .github/workflows/code_health.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/code_health.yml b/.github/workflows/code_health.yml index 5748f52fe..c5fb5317b 100644 --- a/.github/workflows/code_health.yml +++ b/.github/workflows/code_health.yml @@ -1,6 +1,8 @@ name: Code Health on: + push: + branches: [ '*' ] pull_request: branches: [ master ] jobs: @@ -17,5 +19,5 @@ jobs: steps: - uses: actions/checkout@v2 - - name: MyPy + - name: Mypy linting uses: jpetrucciani/mypy-check@master From 9d1a85b5a108f79061a783610cc263c844f555e3 Mon Sep 17 00:00:00 2001 From: Nikolas De Giorgis Date: Thu, 4 Feb 2021 22:12:33 +0100 Subject: [PATCH 03/12] wip --- .github/workflows/code_health.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/code_health.yml b/.github/workflows/code_health.yml index c5fb5317b..90fa3772f 100644 --- a/.github/workflows/code_health.yml +++ b/.github/workflows/code_health.yml @@ -21,3 +21,5 @@ jobs: - name: Mypy linting uses: jpetrucciani/mypy-check@master + with: + path: 'scripts/*/*.py' From 3783bb8c51f5b5ba463de49582dffc3db0ac3b39 Mon Sep 17 00:00:00 2001 From: Nikolas De Giorgis Date: Thu, 4 Feb 2021 22:14:41 +0100 Subject: [PATCH 04/12] wip --- .github/workflows/code_health.yml | 2 -- mypy.ini | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/code_health.yml b/.github/workflows/code_health.yml index 90fa3772f..6cec37a0a 100644 --- a/.github/workflows/code_health.yml +++ b/.github/workflows/code_health.yml @@ -1,8 +1,6 @@ name: Code Health on: - push: - branches: [ '*' ] pull_request: branches: [ master ] jobs: diff --git a/mypy.ini b/mypy.ini index 778152178..46f77830e 100644 --- a/mypy.ini +++ b/mypy.ini @@ -5,4 +5,4 @@ python_version = 3.7 ignore_missing_imports = true disallow_untyped_calls = true disallow_untyped_defs = true -disallow_incomplete_defs = true \ No newline at end of file +disallow_incomplete_defs = true From e04768f7944514731397f888fba11fd159a7a120 Mon Sep 17 00:00:00 2001 From: Nikolas De Giorgis Date: Thu, 4 Feb 2021 22:18:13 +0100 Subject: [PATCH 05/12] wip --- .github/workflows/code_health.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code_health.yml b/.github/workflows/code_health.yml index 6cec37a0a..2689ced2a 100644 --- a/.github/workflows/code_health.yml +++ b/.github/workflows/code_health.yml @@ -20,4 +20,4 @@ jobs: - name: Mypy linting uses: jpetrucciani/mypy-check@master with: - path: 'scripts/*/*.py' + path: '**/*.py' From e901bf6403e0f5a3e0c0281c0923800a1adb6041 Mon Sep 17 00:00:00 2001 From: Nikolas De Giorgis Date: Thu, 4 Feb 2021 22:20:02 +0100 Subject: [PATCH 06/12] temporary test --- .github/workflows/code_health.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/code_health.yml b/.github/workflows/code_health.yml index 2689ced2a..6960cb266 100644 --- a/.github/workflows/code_health.yml +++ b/.github/workflows/code_health.yml @@ -1,6 +1,8 @@ name: Code Health on: + push: + branches: [ '*' ] pull_request: branches: [ master ] jobs: From 2720b91df6c3d174d737254cace0d7e2adbe812d Mon Sep 17 00:00:00 2001 From: Nikolas De Giorgis Date: Thu, 4 Feb 2021 22:20:36 +0100 Subject: [PATCH 07/12] wip --- .github/workflows/code_health.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/code_health.yml b/.github/workflows/code_health.yml index 6960cb266..2689ced2a 100644 --- a/.github/workflows/code_health.yml +++ b/.github/workflows/code_health.yml @@ -1,8 +1,6 @@ name: Code Health on: - push: - branches: [ '*' ] pull_request: branches: [ master ] jobs: From 0446c6c999590c3ca9da01592c9c6b6a9b8b2bc0 Mon Sep 17 00:00:00 2001 From: Nikolas De Giorgis Date: Thu, 4 Feb 2021 22:21:52 +0100 Subject: [PATCH 08/12] wip --- .github/workflows/code_health.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/code_health.yml b/.github/workflows/code_health.yml index 2689ced2a..47fd5a361 100644 --- a/.github/workflows/code_health.yml +++ b/.github/workflows/code_health.yml @@ -1,6 +1,8 @@ name: Code Health on: + push: + branches: [ '*' ] pull_request: branches: [ master ] jobs: @@ -20,4 +22,4 @@ jobs: - name: Mypy linting uses: jpetrucciani/mypy-check@master with: - path: '**/*.py' + path: scripts/*/*.py From 607c88e2b5a34287076fd4a4987da1b862bb6adf Mon Sep 17 00:00:00 2001 From: Nikolas De Giorgis Date: Thu, 4 Feb 2021 22:22:05 +0100 Subject: [PATCH 09/12] wip --- .github/workflows/code_health.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code_health.yml b/.github/workflows/code_health.yml index 47fd5a361..117a84061 100644 --- a/.github/workflows/code_health.yml +++ b/.github/workflows/code_health.yml @@ -22,4 +22,4 @@ jobs: - name: Mypy linting uses: jpetrucciani/mypy-check@master with: - path: scripts/*/*.py + path: */*.py From 6cdb4c443992ff3dc3ea46549a947fc99f8d2b2f Mon Sep 17 00:00:00 2001 From: Nikolas De Giorgis Date: Thu, 4 Feb 2021 22:26:41 +0100 Subject: [PATCH 10/12] wip --- .github/workflows/code_health.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code_health.yml b/.github/workflows/code_health.yml index 117a84061..f74602eb1 100644 --- a/.github/workflows/code_health.yml +++ b/.github/workflows/code_health.yml @@ -22,4 +22,4 @@ jobs: - name: Mypy linting uses: jpetrucciani/mypy-check@master with: - path: */*.py + path: \**/*.py From 49cb529f2ae62e384ceb42c2997ba5a23f587f40 Mon Sep 17 00:00:00 2001 From: Nikolas De Giorgis Date: Thu, 4 Feb 2021 22:33:45 +0100 Subject: [PATCH 11/12] wip --- .github/workflows/code_health.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code_health.yml b/.github/workflows/code_health.yml index f74602eb1..47fd5a361 100644 --- a/.github/workflows/code_health.yml +++ b/.github/workflows/code_health.yml @@ -22,4 +22,4 @@ jobs: - name: Mypy linting uses: jpetrucciani/mypy-check@master with: - path: \**/*.py + path: scripts/*/*.py From dcab6ef2aaa2157815fd4c716a15d194e2faf91a Mon Sep 17 00:00:00 2001 From: Nikolas De Giorgis Date: Thu, 4 Feb 2021 22:33:57 +0100 Subject: [PATCH 12/12] wip --- .github/workflows/code_health.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/code_health.yml b/.github/workflows/code_health.yml index 47fd5a361..8be014241 100644 --- a/.github/workflows/code_health.yml +++ b/.github/workflows/code_health.yml @@ -1,8 +1,6 @@ name: Code Health on: - push: - branches: [ '*' ] pull_request: branches: [ master ] jobs: