From ca737e080fe3466c56d4c876088c0ee55be5af27 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 831469d01c59ea14e0a5bdaea859cc2dd92e1991 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 d8cfbc104211334935f91b383ead0821edc4e8ad 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 548ecf8e0824da7c161fd6d8da5bf11f7daa651f 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 d555584e90a06082e6631a8794890fe8a6fc995c 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 c8191e60ba0c9c1800a5ffc9c41777e7f2576c96 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 7f64d06ad42f9230e922c96b42d5649f6ead420a 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 c641f67914024afdd6600df797bfbf5751f12bf4 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 81a8058836ac30259ca570e0c912e2b385cdbc55 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 a303e9096a8cf6a1d31698a7a9d841b270969317 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 dcf5bfddfaee41081a14fd8acc3b622a2f06bace 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 6c7ec6216680f7043e30939da7a0b7ecc2312edc 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 1633900ce76cbf9164d1c0a44c78852f49a0c36d 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