From 0c7016341cb49f4624cb9f1dd03431a5a75eb861 Mon Sep 17 00:00:00 2001 From: Eirikur Jonsson Date: Tue, 11 Nov 2025 11:24:18 +0000 Subject: [PATCH 1/4] adding mypy as an option to run --- azure/azure_style.yaml | 28 ++++++++++++++++++++++++++++ azure/azure_template.yaml | 3 +++ 2 files changed, 31 insertions(+) diff --git a/azure/azure_style.yaml b/azure/azure_style.yaml index 210017f..ee02132 100644 --- a/azure/azure_style.yaml +++ b/azure/azure_style.yaml @@ -23,6 +23,12 @@ parameters: - name: FPRETTIFY type: boolean default: false + - name: RUFF + type: boolean + default: false + - name: MYPY + type: boolean + default: false jobs: - job: base_format_and_lint pool: @@ -153,4 +159,26 @@ jobs: # Exit with an error if any of the tracked files changed git diff --summary --exit-code + - job: mypy + pool: + vmImage: "ubuntu-22.04" + timeoutInMinutes: ${{ parameters.TIMEOUT }} + continueOnError: ${{ parameters.IGNORE_STYLE }} + condition: ${{ parameters.MYPY }} + steps: + - checkout: self + - checkout: azure_template + - task: UsePythonVersion@0 + inputs: + versionSpec: "3.11" + - script: | + cd ${{ parameters.REPO_NAME }} + + pip install wheel + pip install mypy + + # Run mypy check and print to screen + mypy --any-exprs-report mypy-output . + cat mypy-output/any-exprs.txt + diff --git a/azure/azure_template.yaml b/azure/azure_template.yaml index 4a3bb66..9312b7e 100644 --- a/azure/azure_template.yaml +++ b/azure/azure_template.yaml @@ -57,6 +57,9 @@ parameters: - name: RUFF type: boolean default: false + - name: MYPY + type: boolean + default: false # Tapenade - name: TAPENADE type: boolean From 167393401159115989646fdd77f15be440b07f74 Mon Sep 17 00:00:00 2001 From: Eirikur Jonsson Date: Tue, 11 Nov 2025 14:11:28 +0000 Subject: [PATCH 2/4] updates to input params --- README.md | 1 + azure/README.md | 3 ++- azure/azure_style.yaml | 3 --- azure/azure_template.yaml | 8 +++++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 9c726c0..6b306c3 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ This repo stores the following shared repository settings/configurations/templat - `isort` - `pylint` - `codecov` + - `mypy` - Shared configurations for Azure Pipelines - Shared configurations for GitHub Actions - Issue/PR labels shared across the organization diff --git a/azure/README.md b/azure/README.md index cda1b47..32c5aed 100644 --- a/azure/README.md +++ b/azure/README.md @@ -27,11 +27,12 @@ The templates are organized into the following files: | `COVERAGE` | boolean | `false` | Flag to report test coverage to `codecov` | | `TIMEOUT_STYLE` | number | `10` | Runtime allowed for each style check, in minutes | | `IGNORE_STYLE` | boolean | `false` | Flag to allow `formatting and linting` checks to fail without failing the pipeline | -| `BASE_FORMAT_AND_LINT` | boolean | `false` | Flag to trigger the `base_format_and_lint` check | +| `BASE_FORMAT_AND_LINT` | boolean | `true` | Flag to trigger the `base_format_and_lint` check | | `ISORT` | boolean | `false` | Flag to trigger the `isort` check | | `PYLINT` | boolean | `false` | Flag to trigger the `pylint` check | | `CLANG_FORMAT` | boolean | `false` | Flag to trigger the `clang-format` check | | `FPRETTIFY` | boolean | `false` | Flag to trigger the `fprettify` check | +| `MYPY` | boolean | `false` | Flag to trigger the `mypy` check | | `TAPENADE` | boolean | `false` | Flag to trigger the Tapenade check | | `TIMEOUT_TAPENADE` | number | `10` | Runtime allowed for the Tapenade check, in minutes | | `TAPENADE_SCRIPT` | string | `.github/build_tapenade.sh` | Path to Bash script with commands to run Tapenade | diff --git a/azure/azure_style.yaml b/azure/azure_style.yaml index ee02132..819d901 100644 --- a/azure/azure_style.yaml +++ b/azure/azure_style.yaml @@ -23,9 +23,6 @@ parameters: - name: FPRETTIFY type: boolean default: false - - name: RUFF - type: boolean - default: false - name: MYPY type: boolean default: false diff --git a/azure/azure_template.yaml b/azure/azure_template.yaml index 9312b7e..76e21f5 100644 --- a/azure/azure_template.yaml +++ b/azure/azure_template.yaml @@ -42,6 +42,9 @@ parameters: - name: IGNORE_STYLE type: boolean default: false + - name: BASE_FORMAT_AND_LINT + type: boolean + default: true - name: ISORT type: boolean default: false @@ -54,9 +57,6 @@ parameters: - name: FPRETTIFY type: boolean default: false - - name: RUFF - type: boolean - default: false - name: MYPY type: boolean default: false @@ -118,10 +118,12 @@ stages: REPO_NAME: ${{ parameters.REPO_NAME }} TIMEOUT: ${{ parameters.TIMEOUT_STYLE }} IGNORE_STYLE: ${{ parameters.IGNORE_STYLE }} + BASE_FORMAT_AND_LINT: ${{ parameters.BASE_FORMAT_AND_LINT }} ISORT: ${{ parameters.ISORT }} PYLINT: ${{ parameters.PYLINT }} CLANG_FORMAT: ${{ parameters.CLANG_FORMAT }} FPRETTIFY: ${{ parameters.FPRETTIFY }} + MYPY: ${{ parameters.MYPY }} - stage: Tapenade dependsOn: [] From 29b55c35f838a8ea166bdcf9776b52f6f65e8c9e Mon Sep 17 00:00:00 2001 From: Eirikur Jonsson Date: Sun, 23 Nov 2025 11:50:09 +0000 Subject: [PATCH 3/4] do not create a report --- azure/azure_style.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/azure/azure_style.yaml b/azure/azure_style.yaml index 819d901..08d5df6 100644 --- a/azure/azure_style.yaml +++ b/azure/azure_style.yaml @@ -175,7 +175,6 @@ jobs: pip install mypy # Run mypy check and print to screen - mypy --any-exprs-report mypy-output . - cat mypy-output/any-exprs.txt + mypy . From 92cf3051f69ab9af684639f89e40415f1ce35a26 Mon Sep 17 00:00:00 2001 From: Eirikur Jonsson Date: Tue, 25 Nov 2025 14:14:25 +0000 Subject: [PATCH 4/4] update call --- azure/azure_style.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure/azure_style.yaml b/azure/azure_style.yaml index 08d5df6..2236365 100644 --- a/azure/azure_style.yaml +++ b/azure/azure_style.yaml @@ -174,7 +174,7 @@ jobs: pip install wheel pip install mypy - # Run mypy check and print to screen - mypy . + # Run mypy check (should pick up local config from mypy.ini or .mypy.ini if present) + mypy