Update platform for new version manifest generator (#29)

* Update build-python-packages.yml

* update platforms

* fix platform conditions

* add clean up
This commit is contained in:
Maxim Lobanov 2020-06-03 20:38:34 +03:00 committed by GitHub
parent 06026eac83
commit 2a3a8176d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 28 additions and 61 deletions

View File

@ -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
@ -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
@ -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
@ -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
@ -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
@ -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
@ -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
@ -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
@ -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
@ -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
@ -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
@ -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

View File

@ -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'
@ -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
@ -40,7 +47,7 @@ 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'
@ -48,9 +55,9 @@ jobs:
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'

View File

@ -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"

View File

@ -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"
}

@ -1 +1 @@
Subproject commit d8c3ce72eebad99e5377a15501ae2135ee4b2427
Subproject commit 350e2888aa8ba786f16e7e37479c41551326d25c

View File

@ -1,29 +0,0 @@
{
"macos-1014": [
{
"platform": "darwin",
"platform_version": "10.14"
},
{
"platform": "darwin",
"platform_version": "10.15"
}
],
"ubuntu-1604": [
{
"platform": "linux",
"platform_version": "16.04"
}
],
"ubuntu-1804": [
{
"platform": "linux",
"platform_version": "18.04"
}
],
"windows-2016": [
{
"platform": "win32"
}
]
}

View File

@ -1,11 +0,0 @@
if ($env:PLATFORM -match 'windows') {
$PythonFilter = "Name like '%Python%'"
Get-WmiObject Win32_Product -Filter $PythonFilter | Foreach-Object {
Write-Host "Uninstalling $($_.Name) ..."
$_.Uninstall() | Out-Null
}
}
$PythonToolcachePath = Join-Path -Path $env:AGENT_TOOLSDIRECTORY -ChildPath "Python"
Write-Host "Removing Python toolcache directory ..."
Remove-Item -Path $PythonToolcachePath -Recurse -Force