Skip to content

Commit

Permalink
Update platform for new version manifest generator (#29)
Browse files Browse the repository at this point in the history
* Update build-python-packages.yml

* update platforms

* fix platform conditions

* add clean up
  • Loading branch information
maxim-lobanov authored Jun 3, 2020
1 parent 06026ea commit 2a3a817
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 61 deletions.
24 changes: 12 additions & 12 deletions azure-pipelines/build-python-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ stages:
dependsOn: []
variables:
VmImage: 'macOS-10.14'
Platform: macos-1014
Platform: darwin
Architecture: x64
jobs:
- template: /azure-pipelines/templates/build-job.yml
Expand All @@ -17,7 +17,7 @@ stages:
dependsOn: Build_Python_MacOS
variables:
VmImage: 'macOS-10.14'
Platform: macos-1014
Platform: darwin
Architecture: x64
jobs:
- template: /azure-pipelines/templates/test-job.yml
Expand All @@ -26,7 +26,7 @@ stages:
dependsOn: []
variables:
VmImage: 'ubuntu-16.04'
Platform: ubuntu-1604
Platform: linux-16.04
Architecture: x64
jobs:
- template: /azure-pipelines/templates/build-job.yml
Expand All @@ -36,7 +36,7 @@ stages:
dependsOn: Build_Python_Ubuntu_1604
variables:
VmImage: 'ubuntu-16.04'
Platform: ubuntu-1604
Platform: linux-16.04
Architecture: x64
jobs:
- template: /azure-pipelines/templates/test-job.yml
Expand All @@ -45,7 +45,7 @@ stages:
dependsOn: []
variables:
VmImage: 'ubuntu-18.04'
Platform: ubuntu-1804
Platform: linux-18.04
Architecture: x64
jobs:
- template: /azure-pipelines/templates/build-job.yml
Expand All @@ -55,7 +55,7 @@ stages:
dependsOn: Build_Python_Ubuntu_1804
variables:
VmImage: 'ubuntu-18.04'
Platform: ubuntu-1804
Platform: linux-18.04
Architecture: x64
jobs:
- template: /azure-pipelines/templates/test-job.yml
Expand All @@ -64,7 +64,7 @@ stages:
dependsOn: []
variables:
VmImage: 'ubuntu-20.04'
Platform: ubuntu-2004
Platform: linux-20.04
Architecture: x64
jobs:
- template: /azure-pipelines/templates/build-job.yml
Expand All @@ -74,7 +74,7 @@ stages:
dependsOn: Build_Python_Ubuntu_2004
variables:
VmImage: 'ubuntu-20.04'
Platform: ubuntu-2004
Platform: linux-20.04
Architecture: x64
jobs:
- template: /azure-pipelines/templates/test-job.yml
Expand All @@ -83,7 +83,7 @@ stages:
dependsOn: []
variables:
VmImage: 'vs2017-win2016'
Platform: windows-2016
Platform: win32
Architecture: x64
jobs:
- template: /azure-pipelines/templates/build-job.yml
Expand All @@ -93,7 +93,7 @@ stages:
dependsOn: Build_Python_X64_Windows
variables:
VmImage: 'vs2017-win2016'
Platform: windows-2016
Platform: win32
Architecture: x64
jobs:
- template: /azure-pipelines/templates/test-job.yml
Expand All @@ -102,7 +102,7 @@ stages:
dependsOn: []
variables:
VmImage: 'vs2017-win2016'
Platform: windows-2016
Platform: win32
Architecture: x86
jobs:
- template: /azure-pipelines/templates/build-job.yml
Expand All @@ -112,7 +112,7 @@ stages:
dependsOn: Build_Python_x86_Windows
variables:
VmImage: 'vs2017-win2016'
Platform: windows-2016
Platform: win32
Architecture: x86
jobs:
- template: /azure-pipelines/templates/test-job.yml
15 changes: 11 additions & 4 deletions azure-pipelines/templates/test-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ jobs:
- checkout: self
submodules: true

- task: PowerShell@2
displayName: Fully cleanup the toolcache directory before testing
inputs:
targetType: filePath
filePath: helpers/clean-toolcache.ps1
arguments: -ToolName "Python"

- task: DownloadPipelineArtifact@2
inputs:
source: 'current'
Expand All @@ -24,7 +31,7 @@ jobs:
inputs:
TargetType: inline
script: |
if ($env:PLATFORM -match 'windows') { powershell ./setup.ps1 } else { sh ./setup.sh }
if ($env:PLATFORM -match 'win32') { powershell ./setup.ps1 } else { sh ./setup.sh }
workingDirectory: '$(Build.BinariesDirectory)'

- task: UsePythonVersion@0
Expand All @@ -40,17 +47,17 @@ jobs:
script: |
Invoke-Expression "python ./sources/python-config-output.py"
workingDirectory: '$(Build.SourcesDirectory)/tests'
condition: ne(variables['Platform'], 'windows-2016')
condition: ne(variables['Platform'], 'win32')

- task: PowerShell@2
displayName: 'Verbose python binary links'
inputs:
TargetType: inline
script: |
$pythonLocation = which python
if ($env:PLATFORM -match 'macos') { otool -L $pythonLocation } else { ldd $pythonLocation }
if ($env:PLATFORM -match 'darwin') { otool -L $pythonLocation } else { ldd $pythonLocation }
workingDirectory: '$(Build.BinariesDirectory)'
condition: ne(variables['Platform'], 'windows-2016')
condition: ne(variables['Platform'], 'win32')

- task: PowerShell@2
displayName: 'Run tests'
Expand Down
6 changes: 3 additions & 3 deletions builders/build-python.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ function Get-PythonBuilder {
)

$Platform = $Platform.ToLower()
if ($Platform -match 'windows') {
if ($Platform -match 'win32') {
$builder = [WinPythonBuilder]::New($Version, $Architecture, $Platform)
} elseif ($Platform -match 'ubuntu') {
} elseif ($Platform -match 'linux') {
$builder = [UbuntuPythonBuilder]::New($Version, $Architecture, $Platform)
} elseif ($Platform -match 'macos') {
} elseif ($Platform -match 'darwin') {
$builder = [macOSPythonBuilder]::New($Version, $Architecture, $Platform)
} else {
Write-Host "##vso[task.logissue type=error;] Invalid platform: $Platform"
Expand Down
2 changes: 1 addition & 1 deletion builders/ubuntu-python-builder.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class UbuntuPythonBuilder : NixPythonBuilder {
Execute-Command -Command "sudo apt install -y $_"
}

if ($this.Platform -ne "ubuntu-1604") {
if ($this.Platform -ne "linux-16.04") {
### On Ubuntu-1804, libgdbm-compat-dev has older modules that are no longer in libgdbm-dev
Execute-Command -Command "sudo apt install -y libgdbm-compat-dev"
}
Expand Down
2 changes: 1 addition & 1 deletion helpers
Submodule helpers updated 1 files
+2 −2 common-helpers.psm1
29 changes: 0 additions & 29 deletions installers/map_python_platforms.json

This file was deleted.

11 changes: 0 additions & 11 deletions tests/clean-toolcache.ps1

This file was deleted.

0 comments on commit 2a3a817

Please sign in to comment.