From 59b34ffdf251bf5574a969e71260e85d85c4eb6c Mon Sep 17 00:00:00 2001 From: Marek Wolan Date: Mon, 10 Jul 2023 10:25:26 +0000 Subject: [PATCH 01/13] Changed build pipeline experimentally. --- .azure/azure-ci-build-pipeline.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.azure/azure-ci-build-pipeline.yaml b/.azure/azure-ci-build-pipeline.yaml index 902eb38d..fe50fb32 100644 --- a/.azure/azure-ci-build-pipeline.yaml +++ b/.azure/azure-ci-build-pipeline.yaml @@ -11,21 +11,27 @@ strategy: UbuntuPython38: python.version: '3.8' imageName: 'ubuntu-latest' + condition: eq(variables['Build.Reason'], 'PullRequest') UbuntuPython310: python.version: '3.10' imageName: 'ubuntu-latest' WindowsPython38: python.version: '3.8' imageName: 'windows-latest' + condition: eq(variables['Build.Reason'], 'PullRequest') WindowsPython310: python.version: '3.10' imageName: 'windows-latest' + condition: eq(variables['Build.Reason'], 'PullRequest') MacOSPython38: python.version: '3.8' imageName: 'macOS-latest' + condition: eq(variables['Build.Reason'], 'PullRequest') MacOSPython310: python.version: '3.10' imageName: 'macOS-latest' + condition: eq(variables['Build.Reason'], 'PullRequest') + # pretty sure this does not support a 'condition' parameter but worth a try. Otherwise a more complicated solution might be warranted. pool: vmImage: $(imageName) From d90a00d06330f14c66328f132d5a9b85c02251c0 Mon Sep 17 00:00:00 2001 From: Marek Wolan Date: Tue, 11 Jul 2023 07:16:11 +0000 Subject: [PATCH 02/13] Built matrix conditionally --- .azure/azure-ci-build-pipeline.yaml | 47 ++++++++++++++--------------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/.azure/azure-ci-build-pipeline.yaml b/.azure/azure-ci-build-pipeline.yaml index fe50fb32..bb9c03fa 100644 --- a/.azure/azure-ci-build-pipeline.yaml +++ b/.azure/azure-ci-build-pipeline.yaml @@ -8,30 +8,29 @@ trigger: strategy: matrix: - UbuntuPython38: - python.version: '3.8' - imageName: 'ubuntu-latest' - condition: eq(variables['Build.Reason'], 'PullRequest') - UbuntuPython310: - python.version: '3.10' - imageName: 'ubuntu-latest' - WindowsPython38: - python.version: '3.8' - imageName: 'windows-latest' - condition: eq(variables['Build.Reason'], 'PullRequest') - WindowsPython310: - python.version: '3.10' - imageName: 'windows-latest' - condition: eq(variables['Build.Reason'], 'PullRequest') - MacOSPython38: - python.version: '3.8' - imageName: 'macOS-latest' - condition: eq(variables['Build.Reason'], 'PullRequest') - MacOSPython310: - python.version: '3.10' - imageName: 'macOS-latest' - condition: eq(variables['Build.Reason'], 'PullRequest') - # pretty sure this does not support a 'condition' parameter but worth a try. Otherwise a more complicated solution might be warranted. + ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: + UbuntuPython38: + python.version: '3.8' + imageName: 'ubuntu-latest' + UbuntuPython310: + python.version: '3.10' + imageName: 'ubuntu-latest' + WindowsPython38: + python.version: '3.8' + imageName: 'windows-latest' + WindowsPython310: + python.version: '3.10' + imageName: 'windows-latest' + MacOSPython38: + python.version: '3.8' + imageName: 'macOS-latest' + MacOSPython310: + python.version: '3.10' + imageName: 'macOS-latest' + ${{ if not(eq(variables['Build.Reason'], 'PullRequest')) }}: + UbuntuPython310: + python.version: '3.10' + imageName: 'ubuntu-latest' pool: vmImage: $(imageName) From 71f02d46d1047451727ad5607a7d24e7fca629e7 Mon Sep 17 00:00:00 2001 From: Marek Wolan Date: Tue, 11 Jul 2023 07:19:58 +0000 Subject: [PATCH 03/13] Updated azure-ci-build-pipeline.yaml --- .azure/azure-ci-build-pipeline.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.azure/azure-ci-build-pipeline.yaml b/.azure/azure-ci-build-pipeline.yaml index bb9c03fa..9c21577b 100644 --- a/.azure/azure-ci-build-pipeline.yaml +++ b/.azure/azure-ci-build-pipeline.yaml @@ -7,8 +7,8 @@ trigger: - release/* strategy: - matrix: - ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: + ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: + matrix: UbuntuPython38: python.version: '3.8' imageName: 'ubuntu-latest' @@ -27,7 +27,8 @@ strategy: MacOSPython310: python.version: '3.10' imageName: 'macOS-latest' - ${{ if not(eq(variables['Build.Reason'], 'PullRequest')) }}: + ${{ if not(eq(variables['Build.Reason'], 'PullRequest')) }}: + matrix: UbuntuPython310: python.version: '3.10' imageName: 'ubuntu-latest' From 0911efe4d002a400a0a49a4fc9fcf6840064e61a Mon Sep 17 00:00:00 2001 From: Marek Wolan Date: Tue, 11 Jul 2023 08:05:38 +0000 Subject: [PATCH 04/13] Edit pipeline to use runtime parameters https://stackoverflow.com/a/70046417 --- .azure/azure-ci-build-pipeline.yaml | 124 +++++++++++++++------------- 1 file changed, 66 insertions(+), 58 deletions(-) diff --git a/.azure/azure-ci-build-pipeline.yaml b/.azure/azure-ci-build-pipeline.yaml index 9c21577b..b1557b7b 100644 --- a/.azure/azure-ci-build-pipeline.yaml +++ b/.azure/azure-ci-build-pipeline.yaml @@ -6,75 +6,83 @@ trigger: - bugfix/* - release/* -strategy: - ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: - matrix: +parameters: + # https://stackoverflow.com/a/70046417 + - name: matrix + type: object + default: UbuntuPython38: - python.version: '3.8' - imageName: 'ubuntu-latest' + py: '3.8' + img: 'ubuntu-latest' + only_pr: false UbuntuPython310: - python.version: '3.10' - imageName: 'ubuntu-latest' + py: '3.10' + img: 'ubuntu-latest' + only_pr: true WindowsPython38: - python.version: '3.8' - imageName: 'windows-latest' + py: '3.8' + img: 'windows-latest' + only_pr: false WindowsPython310: - python.version: '3.10' - imageName: 'windows-latest' + py: '3.10' + img: 'windows-latest' + only_pr: false MacOSPython38: - python.version: '3.8' - imageName: 'macOS-latest' + py: '3.8' + img: 'macOS-latest' + only_pr: false MacOSPython310: - python.version: '3.10' - imageName: 'macOS-latest' - ${{ if not(eq(variables['Build.Reason'], 'PullRequest')) }}: - matrix: - UbuntuPython310: - python.version: '3.10' - imageName: 'ubuntu-latest' + py: '3.10' + img: 'macOS-latest' + only_pr: false -pool: - vmImage: $(imageName) +stages: + - stage: Test + jobs: + - ${{ each item in parameters.matrix }}: + ${{ if or(eq(variables['Build.Reason'], 'PullRequest'), item.value.on_pr) }}: + - job: ${{ item.Key }} + pool: + vmImage: ${{ item.Value.img }} + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: ${{ item.Value.py }} + displayName: 'Use Python ${{ item.Value.py }}' -steps: -- task: UsePythonVersion@0 - inputs: - versionSpec: '$(python.version)' - displayName: 'Use Python $(python.version)' + - script: | + python -m pip install pre-commit + pre-commit install + pre-commit run --all-files + displayName: 'Run pre-commits' -- script: | - python -m pip install pre-commit - pre-commit install - pre-commit run --all-files - displayName: 'Run pre-commits' + - script: | + python -m pip install --upgrade pip==23.0.1 + pip install wheel==0.38.4 --upgrade + pip install setuptools==66 --upgrade + pip install build==0.10.0 + pip install pytest-azurepipelines + displayName: 'Install build dependencies' -- script: | - python -m pip install --upgrade pip==23.0.1 - pip install wheel==0.38.4 --upgrade - pip install setuptools==66 --upgrade - pip install build==0.10.0 - pip install pytest-azurepipelines - displayName: 'Install build dependencies' + - script: | + python -m build + displayName: 'Build PrimAITE' -- script: | - python -m build - displayName: 'Build PrimAITE' + - script: | + PRIMAITE_WHEEL=$(ls ./dist/primaite*.whl) + python -m pip install $PRIMAITE_WHEEL[dev] + displayName: 'Install PrimAITE' + condition: or(eq( variables['Agent.OS'], 'Linux' ), eq( variables['Agent.OS'], 'Darwin' )) -- script: | - PRIMAITE_WHEEL=$(ls ./dist/primaite*.whl) - python -m pip install $PRIMAITE_WHEEL[dev] - displayName: 'Install PrimAITE' - condition: or(eq( variables['Agent.OS'], 'Linux' ), eq( variables['Agent.OS'], 'Darwin' )) + - script: | + forfiles /p dist\ /m *.whl /c "cmd /c python -m pip install @file[dev]" + displayName: 'Install PrimAITE' + condition: eq( variables['Agent.OS'], 'Windows_NT' ) -- script: | - forfiles /p dist\ /m *.whl /c "cmd /c python -m pip install @file[dev]" - displayName: 'Install PrimAITE' - condition: eq( variables['Agent.OS'], 'Windows_NT' ) + - script: | + primaite setup + displayName: 'Perform PrimAITE Setup' -- script: | - primaite setup - displayName: 'Perform PrimAITE Setup' - -- script: | - pytest tests/ - displayName: 'Run tests' + - script: | + pytest tests/ + displayName: 'Run tests' From 65d91e01a79b6f2bf016e10bcf1f186d64c3296a Mon Sep 17 00:00:00 2001 From: Marek Wolan Date: Tue, 11 Jul 2023 08:08:29 +0000 Subject: [PATCH 05/13] Potentially fix syntax error --- .azure/azure-ci-build-pipeline.yaml | 68 ++++++++++++++--------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/.azure/azure-ci-build-pipeline.yaml b/.azure/azure-ci-build-pipeline.yaml index b1557b7b..ba2c6d51 100644 --- a/.azure/azure-ci-build-pipeline.yaml +++ b/.azure/azure-ci-build-pipeline.yaml @@ -45,44 +45,44 @@ stages: pool: vmImage: ${{ item.Value.img }} steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: ${{ item.Value.py }} - displayName: 'Use Python ${{ item.Value.py }}' + - task: UsePythonVersion@0 + inputs: + versionSpec: ${{ item.Value.py }} + displayName: 'Use Python ${{ item.Value.py }}' - - script: | - python -m pip install pre-commit - pre-commit install - pre-commit run --all-files - displayName: 'Run pre-commits' + - script: | + python -m pip install pre-commit + pre-commit install + pre-commit run --all-files + displayName: 'Run pre-commits' - - script: | - python -m pip install --upgrade pip==23.0.1 - pip install wheel==0.38.4 --upgrade - pip install setuptools==66 --upgrade - pip install build==0.10.0 - pip install pytest-azurepipelines - displayName: 'Install build dependencies' + - script: | + python -m pip install --upgrade pip==23.0.1 + pip install wheel==0.38.4 --upgrade + pip install setuptools==66 --upgrade + pip install build==0.10.0 + pip install pytest-azurepipelines + displayName: 'Install build dependencies' - - script: | - python -m build - displayName: 'Build PrimAITE' + - script: | + python -m build + displayName: 'Build PrimAITE' - - script: | - PRIMAITE_WHEEL=$(ls ./dist/primaite*.whl) - python -m pip install $PRIMAITE_WHEEL[dev] - displayName: 'Install PrimAITE' - condition: or(eq( variables['Agent.OS'], 'Linux' ), eq( variables['Agent.OS'], 'Darwin' )) + - script: | + PRIMAITE_WHEEL=$(ls ./dist/primaite*.whl) + python -m pip install $PRIMAITE_WHEEL[dev] + displayName: 'Install PrimAITE' + condition: or(eq( variables['Agent.OS'], 'Linux' ), eq( variables['Agent.OS'], 'Darwin' )) - - script: | - forfiles /p dist\ /m *.whl /c "cmd /c python -m pip install @file[dev]" - displayName: 'Install PrimAITE' - condition: eq( variables['Agent.OS'], 'Windows_NT' ) + - script: | + forfiles /p dist\ /m *.whl /c "cmd /c python -m pip install @file[dev]" + displayName: 'Install PrimAITE' + condition: eq( variables['Agent.OS'], 'Windows_NT' ) - - script: | - primaite setup - displayName: 'Perform PrimAITE Setup' + - script: | + primaite setup + displayName: 'Perform PrimAITE Setup' - - script: | - pytest tests/ - displayName: 'Run tests' + - script: | + pytest tests/ + displayName: 'Run tests' From ebf07ce5c1e470dd5df9e16da5524ee8a50423b3 Mon Sep 17 00:00:00 2001 From: Marek Wolan Date: Tue, 11 Jul 2023 08:14:08 +0000 Subject: [PATCH 06/13] Typo in word only --- .azure/azure-ci-build-pipeline.yaml | 78 ++++++++++++++--------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/.azure/azure-ci-build-pipeline.yaml b/.azure/azure-ci-build-pipeline.yaml index ba2c6d51..276f0ef1 100644 --- a/.azure/azure-ci-build-pipeline.yaml +++ b/.azure/azure-ci-build-pipeline.yaml @@ -40,49 +40,49 @@ stages: - stage: Test jobs: - ${{ each item in parameters.matrix }}: - ${{ if or(eq(variables['Build.Reason'], 'PullRequest'), item.value.on_pr) }}: - - job: ${{ item.Key }} - pool: - vmImage: ${{ item.Value.img }} - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: ${{ item.Value.py }} - displayName: 'Use Python ${{ item.Value.py }}' + ${{ if or(eq(variables['Build.Reason'], 'PullRequest'), item.value.only_pr) }}: + - job: ${{ item.Key }} + pool: + vmImage: ${{ item.Value.img }} + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: ${{ item.Value.py }} + displayName: 'Use Python ${{ item.Value.py }}' - - script: | - python -m pip install pre-commit - pre-commit install - pre-commit run --all-files - displayName: 'Run pre-commits' + - script: | + python -m pip install pre-commit + pre-commit install + pre-commit run --all-files + displayName: 'Run pre-commits' - - script: | - python -m pip install --upgrade pip==23.0.1 - pip install wheel==0.38.4 --upgrade - pip install setuptools==66 --upgrade - pip install build==0.10.0 - pip install pytest-azurepipelines - displayName: 'Install build dependencies' + - script: | + python -m pip install --upgrade pip==23.0.1 + pip install wheel==0.38.4 --upgrade + pip install setuptools==66 --upgrade + pip install build==0.10.0 + pip install pytest-azurepipelines + displayName: 'Install build dependencies' - - script: | - python -m build - displayName: 'Build PrimAITE' + - script: | + python -m build + displayName: 'Build PrimAITE' - - script: | - PRIMAITE_WHEEL=$(ls ./dist/primaite*.whl) - python -m pip install $PRIMAITE_WHEEL[dev] - displayName: 'Install PrimAITE' - condition: or(eq( variables['Agent.OS'], 'Linux' ), eq( variables['Agent.OS'], 'Darwin' )) + - script: | + PRIMAITE_WHEEL=$(ls ./dist/primaite*.whl) + python -m pip install $PRIMAITE_WHEEL[dev] + displayName: 'Install PrimAITE' + condition: or(eq( variables['Agent.OS'], 'Linux' ), eq( variables['Agent.OS'], 'Darwin' )) - - script: | - forfiles /p dist\ /m *.whl /c "cmd /c python -m pip install @file[dev]" - displayName: 'Install PrimAITE' - condition: eq( variables['Agent.OS'], 'Windows_NT' ) + - script: | + forfiles /p dist\ /m *.whl /c "cmd /c python -m pip install @file[dev]" + displayName: 'Install PrimAITE' + condition: eq( variables['Agent.OS'], 'Windows_NT' ) - - script: | - primaite setup - displayName: 'Perform PrimAITE Setup' + - script: | + primaite setup + displayName: 'Perform PrimAITE Setup' - - script: | - pytest tests/ - displayName: 'Run tests' + - script: | + pytest tests/ + displayName: 'Run tests' From de630d11dee22b63a958f26fb52a4ff7438c45b7 Mon Sep 17 00:00:00 2001 From: Marek Wolan Date: Tue, 11 Jul 2023 08:14:34 +0000 Subject: [PATCH 07/13] Fix indent --- .azure/azure-ci-build-pipeline.yaml | 78 ++++++++++++++--------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/.azure/azure-ci-build-pipeline.yaml b/.azure/azure-ci-build-pipeline.yaml index 276f0ef1..e1a26924 100644 --- a/.azure/azure-ci-build-pipeline.yaml +++ b/.azure/azure-ci-build-pipeline.yaml @@ -40,49 +40,49 @@ stages: - stage: Test jobs: - ${{ each item in parameters.matrix }}: - ${{ if or(eq(variables['Build.Reason'], 'PullRequest'), item.value.only_pr) }}: - - job: ${{ item.Key }} - pool: - vmImage: ${{ item.Value.img }} - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: ${{ item.Value.py }} - displayName: 'Use Python ${{ item.Value.py }}' + ${{ if or(eq(variables['Build.Reason'], 'PullRequest'), item.value.only_pr) }}: + - job: ${{ item.Key }} + pool: + vmImage: ${{ item.Value.img }} + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: ${{ item.Value.py }} + displayName: 'Use Python ${{ item.Value.py }}' - - script: | - python -m pip install pre-commit - pre-commit install - pre-commit run --all-files - displayName: 'Run pre-commits' + - script: | + python -m pip install pre-commit + pre-commit install + pre-commit run --all-files + displayName: 'Run pre-commits' - - script: | - python -m pip install --upgrade pip==23.0.1 - pip install wheel==0.38.4 --upgrade - pip install setuptools==66 --upgrade - pip install build==0.10.0 - pip install pytest-azurepipelines - displayName: 'Install build dependencies' + - script: | + python -m pip install --upgrade pip==23.0.1 + pip install wheel==0.38.4 --upgrade + pip install setuptools==66 --upgrade + pip install build==0.10.0 + pip install pytest-azurepipelines + displayName: 'Install build dependencies' - - script: | - python -m build - displayName: 'Build PrimAITE' + - script: | + python -m build + displayName: 'Build PrimAITE' - - script: | - PRIMAITE_WHEEL=$(ls ./dist/primaite*.whl) - python -m pip install $PRIMAITE_WHEEL[dev] - displayName: 'Install PrimAITE' - condition: or(eq( variables['Agent.OS'], 'Linux' ), eq( variables['Agent.OS'], 'Darwin' )) + - script: | + PRIMAITE_WHEEL=$(ls ./dist/primaite*.whl) + python -m pip install $PRIMAITE_WHEEL[dev] + displayName: 'Install PrimAITE' + condition: or(eq( variables['Agent.OS'], 'Linux' ), eq( variables['Agent.OS'], 'Darwin' )) - - script: | - forfiles /p dist\ /m *.whl /c "cmd /c python -m pip install @file[dev]" - displayName: 'Install PrimAITE' - condition: eq( variables['Agent.OS'], 'Windows_NT' ) + - script: | + forfiles /p dist\ /m *.whl /c "cmd /c python -m pip install @file[dev]" + displayName: 'Install PrimAITE' + condition: eq( variables['Agent.OS'], 'Windows_NT' ) - - script: | - primaite setup - displayName: 'Perform PrimAITE Setup' + - script: | + primaite setup + displayName: 'Perform PrimAITE Setup' - - script: | - pytest tests/ - displayName: 'Run tests' + - script: | + pytest tests/ + displayName: 'Run tests' From 3085057406ebb58357132ea84ab61ff50b97cc2b Mon Sep 17 00:00:00 2001 From: Marek Wolan Date: Tue, 11 Jul 2023 08:15:16 +0000 Subject: [PATCH 08/13] Capitalisation error in value --- .azure/azure-ci-build-pipeline.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure/azure-ci-build-pipeline.yaml b/.azure/azure-ci-build-pipeline.yaml index e1a26924..49fd7174 100644 --- a/.azure/azure-ci-build-pipeline.yaml +++ b/.azure/azure-ci-build-pipeline.yaml @@ -40,7 +40,7 @@ stages: - stage: Test jobs: - ${{ each item in parameters.matrix }}: - ${{ if or(eq(variables['Build.Reason'], 'PullRequest'), item.value.only_pr) }}: + ${{ if or(eq(variables['Build.Reason'], 'PullRequest'), item.Value.only_pr) }}: - job: ${{ item.Key }} pool: vmImage: ${{ item.Value.img }} From 98414a58f3fe4941dc64c5c66bb3c2ab74c30223 Mon Sep 17 00:00:00 2001 From: Marek Wolan Date: Tue, 11 Jul 2023 08:22:30 +0000 Subject: [PATCH 09/13] Change parameter matrix to list instead of dict --- .azure/azure-ci-build-pipeline.yaml | 128 ++++++++++++++-------------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/.azure/azure-ci-build-pipeline.yaml b/.azure/azure-ci-build-pipeline.yaml index 49fd7174..de760316 100644 --- a/.azure/azure-ci-build-pipeline.yaml +++ b/.azure/azure-ci-build-pipeline.yaml @@ -11,78 +11,78 @@ parameters: - name: matrix type: object default: - UbuntuPython38: - py: '3.8' - img: 'ubuntu-latest' - only_pr: false - UbuntuPython310: - py: '3.10' - img: 'ubuntu-latest' - only_pr: true - WindowsPython38: - py: '3.8' - img: 'windows-latest' - only_pr: false - WindowsPython310: - py: '3.10' - img: 'windows-latest' - only_pr: false - MacOSPython38: - py: '3.8' - img: 'macOS-latest' - only_pr: false - MacOSPython310: - py: '3.10' - img: 'macOS-latest' - only_pr: false + - job_name: 'UbuntuPython38' + py: '3.8' + img: 'ubuntu-latest' + only_pr: false + - job_name: 'UbuntuPython310' + py: '3.10' + img: 'ubuntu-latest' + only_pr: true + - job_name: 'WindowsPython38' + py: '3.8' + img: 'windows-latest' + only_pr: false + - job_name: 'WindowsPython310' + py: '3.10' + img: 'windows-latest' + only_pr: false + - job_name: 'MacOSPython38' + py: '3.8' + img: 'macOS-latest' + only_pr: false + - job_name: 'MacOSPython310' + py: '3.10' + img: 'macOS-latest' + only_pr: false stages: - stage: Test jobs: - - ${{ each item in parameters.matrix }}: - ${{ if or(eq(variables['Build.Reason'], 'PullRequest'), item.Value.only_pr) }}: - - job: ${{ item.Key }} - pool: - vmImage: ${{ item.Value.img }} - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: ${{ item.Value.py }} - displayName: 'Use Python ${{ item.Value.py }}' + - ${{ each item in parameters.matrix }}: + ${{ if or(eq(variables['Build.Reason'], 'PullRequest'), item.only_pr) }}: + - job: ${{ item.job_name }} + pool: + vmImage: ${{ item.img }} + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: ${{ item.py }} + displayName: 'Use Python ${{ item.py }}' - - script: | - python -m pip install pre-commit - pre-commit install - pre-commit run --all-files - displayName: 'Run pre-commits' + - script: | + python -m pip install pre-commit + pre-commit install + pre-commit run --all-files + displayName: 'Run pre-commits' - - script: | - python -m pip install --upgrade pip==23.0.1 - pip install wheel==0.38.4 --upgrade - pip install setuptools==66 --upgrade - pip install build==0.10.0 - pip install pytest-azurepipelines - displayName: 'Install build dependencies' + - script: | + python -m pip install --upgrade pip==23.0.1 + pip install wheel==0.38.4 --upgrade + pip install setuptools==66 --upgrade + pip install build==0.10.0 + pip install pytest-azurepipelines + displayName: 'Install build dependencies' - - script: | - python -m build - displayName: 'Build PrimAITE' + - script: | + python -m build + displayName: 'Build PrimAITE' - - script: | - PRIMAITE_WHEEL=$(ls ./dist/primaite*.whl) - python -m pip install $PRIMAITE_WHEEL[dev] - displayName: 'Install PrimAITE' - condition: or(eq( variables['Agent.OS'], 'Linux' ), eq( variables['Agent.OS'], 'Darwin' )) + - script: | + PRIMAITE_WHEEL=$(ls ./dist/primaite*.whl) + python -m pip install $PRIMAITE_WHEEL[dev] + displayName: 'Install PrimAITE' + condition: or(eq( variables['Agent.OS'], 'Linux' ), eq( variables['Agent.OS'], 'Darwin' )) - - script: | - forfiles /p dist\ /m *.whl /c "cmd /c python -m pip install @file[dev]" - displayName: 'Install PrimAITE' - condition: eq( variables['Agent.OS'], 'Windows_NT' ) + - script: | + forfiles /p dist\ /m *.whl /c "cmd /c python -m pip install @file[dev]" + displayName: 'Install PrimAITE' + condition: eq( variables['Agent.OS'], 'Windows_NT' ) - - script: | - primaite setup - displayName: 'Perform PrimAITE Setup' + - script: | + primaite setup + displayName: 'Perform PrimAITE Setup' - - script: | - pytest tests/ - displayName: 'Run tests' + - script: | + pytest tests/ + displayName: 'Run tests' From 186ba094006585b5e057e4f1a8cd510f7b663b22 Mon Sep 17 00:00:00 2001 From: Marek Wolan Date: Tue, 11 Jul 2023 08:53:37 +0000 Subject: [PATCH 10/13] Changed structure of build pipeline yaml --- .azure/azure-ci-build-pipeline.yaml | 92 +++++++++++++++-------------- 1 file changed, 47 insertions(+), 45 deletions(-) diff --git a/.azure/azure-ci-build-pipeline.yaml b/.azure/azure-ci-build-pipeline.yaml index de760316..d8568d46 100644 --- a/.azure/azure-ci-build-pipeline.yaml +++ b/.azure/azure-ci-build-pipeline.yaml @@ -14,75 +14,77 @@ parameters: - job_name: 'UbuntuPython38' py: '3.8' img: 'ubuntu-latest' - only_pr: false + every_time: false - job_name: 'UbuntuPython310' py: '3.10' img: 'ubuntu-latest' - only_pr: true + every_time: true - job_name: 'WindowsPython38' py: '3.8' img: 'windows-latest' - only_pr: false + every_time: false - job_name: 'WindowsPython310' py: '3.10' img: 'windows-latest' - only_pr: false + every_time: false - job_name: 'MacOSPython38' py: '3.8' img: 'macOS-latest' - only_pr: false + every_time: false - job_name: 'MacOSPython310' py: '3.10' img: 'macOS-latest' - only_pr: false + every_time: false stages: - stage: Test jobs: - ${{ each item in parameters.matrix }}: - ${{ if or(eq(variables['Build.Reason'], 'PullRequest'), item.only_pr) }}: - - job: ${{ item.job_name }} - pool: - vmImage: ${{ item.img }} - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: ${{ item.py }} - displayName: 'Use Python ${{ item.py }}' + - job: ${{ item.job_name }} + pool: + vmImage: ${{ item.img }} + + condition: or( eq(variables['BuildReason'], 'PullRequest'), item.every_time ) - - script: | - python -m pip install pre-commit - pre-commit install - pre-commit run --all-files - displayName: 'Run pre-commits' + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: ${{ item.py }} + displayName: 'Use Python ${{ item.py }}' - - script: | - python -m pip install --upgrade pip==23.0.1 - pip install wheel==0.38.4 --upgrade - pip install setuptools==66 --upgrade - pip install build==0.10.0 - pip install pytest-azurepipelines - displayName: 'Install build dependencies' + - script: | + python -m pip install pre-commit + pre-commit install + pre-commit run --all-files + displayName: 'Run pre-commits' - - script: | - python -m build - displayName: 'Build PrimAITE' + - script: | + python -m pip install --upgrade pip==23.0.1 + pip install wheel==0.38.4 --upgrade + pip install setuptools==66 --upgrade + pip install build==0.10.0 + pip install pytest-azurepipelines + displayName: 'Install build dependencies' - - script: | - PRIMAITE_WHEEL=$(ls ./dist/primaite*.whl) - python -m pip install $PRIMAITE_WHEEL[dev] - displayName: 'Install PrimAITE' - condition: or(eq( variables['Agent.OS'], 'Linux' ), eq( variables['Agent.OS'], 'Darwin' )) + - script: | + python -m build + displayName: 'Build PrimAITE' - - script: | - forfiles /p dist\ /m *.whl /c "cmd /c python -m pip install @file[dev]" - displayName: 'Install PrimAITE' - condition: eq( variables['Agent.OS'], 'Windows_NT' ) + - script: | + PRIMAITE_WHEEL=$(ls ./dist/primaite*.whl) + python -m pip install $PRIMAITE_WHEEL[dev] + displayName: 'Install PrimAITE' + condition: or(eq( variables['Agent.OS'], 'Linux' ), eq( variables['Agent.OS'], 'Darwin' )) - - script: | - primaite setup - displayName: 'Perform PrimAITE Setup' + - script: | + forfiles /p dist\ /m *.whl /c "cmd /c python -m pip install @file[dev]" + displayName: 'Install PrimAITE' + condition: eq( variables['Agent.OS'], 'Windows_NT' ) - - script: | - pytest tests/ - displayName: 'Run tests' + - script: | + primaite setup + displayName: 'Perform PrimAITE Setup' + + - script: | + pytest tests/ + displayName: 'Run tests' From 7796ad98f3b3e65495f2da1ef5acd0c725feef7d Mon Sep 17 00:00:00 2001 From: Marek Wolan Date: Tue, 11 Jul 2023 08:54:22 +0000 Subject: [PATCH 11/13] Fix syntax --- .azure/azure-ci-build-pipeline.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure/azure-ci-build-pipeline.yaml b/.azure/azure-ci-build-pipeline.yaml index d8568d46..e3f11b7f 100644 --- a/.azure/azure-ci-build-pipeline.yaml +++ b/.azure/azure-ci-build-pipeline.yaml @@ -44,7 +44,7 @@ stages: pool: vmImage: ${{ item.img }} - condition: or( eq(variables['BuildReason'], 'PullRequest'), item.every_time ) + condition: or( eq(variables['BuildReason'], 'PullRequest'), ${{ item.every_time }} ) steps: - task: UsePythonVersion@0 From 36320968f218c9d85fc68f5d56c668744d290c54 Mon Sep 17 00:00:00 2001 From: Marek Wolan Date: Tue, 11 Jul 2023 09:57:27 +0100 Subject: [PATCH 12/13] Fixed formatting with pre-commit --- .azure/azure-ci-build-pipeline.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure/azure-ci-build-pipeline.yaml b/.azure/azure-ci-build-pipeline.yaml index e3f11b7f..4001b1c5 100644 --- a/.azure/azure-ci-build-pipeline.yaml +++ b/.azure/azure-ci-build-pipeline.yaml @@ -43,7 +43,7 @@ stages: - job: ${{ item.job_name }} pool: vmImage: ${{ item.img }} - + condition: or( eq(variables['BuildReason'], 'PullRequest'), ${{ item.every_time }} ) steps: From f1457f36cb9090a1c4bfe2ae086d6dbd97789500 Mon Sep 17 00:00:00 2001 From: Marek Wolan Date: Tue, 11 Jul 2023 09:01:43 +0000 Subject: [PATCH 13/13] Fix typo in `Build.Reason` --- .azure/azure-ci-build-pipeline.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure/azure-ci-build-pipeline.yaml b/.azure/azure-ci-build-pipeline.yaml index 4001b1c5..066c66b2 100644 --- a/.azure/azure-ci-build-pipeline.yaml +++ b/.azure/azure-ci-build-pipeline.yaml @@ -44,7 +44,7 @@ stages: pool: vmImage: ${{ item.img }} - condition: or( eq(variables['BuildReason'], 'PullRequest'), ${{ item.every_time }} ) + condition: or( eq(variables['Build.Reason'], 'PullRequest'), ${{ item.every_time }} ) steps: - task: UsePythonVersion@0