Skip to content

Commit 2a3a817

Browse files
Update platform for new version manifest generator (actions#29)
* Update build-python-packages.yml * update platforms * fix platform conditions * add clean up
1 parent 06026ea commit 2a3a817

File tree

7 files changed

+28
-61
lines changed

7 files changed

+28
-61
lines changed

azure-pipelines/build-python-packages.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ stages:
77
dependsOn: []
88
variables:
99
VmImage: 'macOS-10.14'
10-
Platform: macos-1014
10+
Platform: darwin
1111
Architecture: x64
1212
jobs:
1313
- template: /azure-pipelines/templates/build-job.yml
@@ -17,7 +17,7 @@ stages:
1717
dependsOn: Build_Python_MacOS
1818
variables:
1919
VmImage: 'macOS-10.14'
20-
Platform: macos-1014
20+
Platform: darwin
2121
Architecture: x64
2222
jobs:
2323
- template: /azure-pipelines/templates/test-job.yml
@@ -26,7 +26,7 @@ stages:
2626
dependsOn: []
2727
variables:
2828
VmImage: 'ubuntu-16.04'
29-
Platform: ubuntu-1604
29+
Platform: linux-16.04
3030
Architecture: x64
3131
jobs:
3232
- template: /azure-pipelines/templates/build-job.yml
@@ -36,7 +36,7 @@ stages:
3636
dependsOn: Build_Python_Ubuntu_1604
3737
variables:
3838
VmImage: 'ubuntu-16.04'
39-
Platform: ubuntu-1604
39+
Platform: linux-16.04
4040
Architecture: x64
4141
jobs:
4242
- template: /azure-pipelines/templates/test-job.yml
@@ -45,7 +45,7 @@ stages:
4545
dependsOn: []
4646
variables:
4747
VmImage: 'ubuntu-18.04'
48-
Platform: ubuntu-1804
48+
Platform: linux-18.04
4949
Architecture: x64
5050
jobs:
5151
- template: /azure-pipelines/templates/build-job.yml
@@ -55,7 +55,7 @@ stages:
5555
dependsOn: Build_Python_Ubuntu_1804
5656
variables:
5757
VmImage: 'ubuntu-18.04'
58-
Platform: ubuntu-1804
58+
Platform: linux-18.04
5959
Architecture: x64
6060
jobs:
6161
- template: /azure-pipelines/templates/test-job.yml
@@ -64,7 +64,7 @@ stages:
6464
dependsOn: []
6565
variables:
6666
VmImage: 'ubuntu-20.04'
67-
Platform: ubuntu-2004
67+
Platform: linux-20.04
6868
Architecture: x64
6969
jobs:
7070
- template: /azure-pipelines/templates/build-job.yml
@@ -74,7 +74,7 @@ stages:
7474
dependsOn: Build_Python_Ubuntu_2004
7575
variables:
7676
VmImage: 'ubuntu-20.04'
77-
Platform: ubuntu-2004
77+
Platform: linux-20.04
7878
Architecture: x64
7979
jobs:
8080
- template: /azure-pipelines/templates/test-job.yml
@@ -83,7 +83,7 @@ stages:
8383
dependsOn: []
8484
variables:
8585
VmImage: 'vs2017-win2016'
86-
Platform: windows-2016
86+
Platform: win32
8787
Architecture: x64
8888
jobs:
8989
- template: /azure-pipelines/templates/build-job.yml
@@ -93,7 +93,7 @@ stages:
9393
dependsOn: Build_Python_X64_Windows
9494
variables:
9595
VmImage: 'vs2017-win2016'
96-
Platform: windows-2016
96+
Platform: win32
9797
Architecture: x64
9898
jobs:
9999
- template: /azure-pipelines/templates/test-job.yml
@@ -102,7 +102,7 @@ stages:
102102
dependsOn: []
103103
variables:
104104
VmImage: 'vs2017-win2016'
105-
Platform: windows-2016
105+
Platform: win32
106106
Architecture: x86
107107
jobs:
108108
- template: /azure-pipelines/templates/build-job.yml
@@ -112,7 +112,7 @@ stages:
112112
dependsOn: Build_Python_x86_Windows
113113
variables:
114114
VmImage: 'vs2017-win2016'
115-
Platform: windows-2016
115+
Platform: win32
116116
Architecture: x86
117117
jobs:
118118
- template: /azure-pipelines/templates/test-job.yml

azure-pipelines/templates/test-job.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ jobs:
77
- checkout: self
88
submodules: true
99

10+
- task: PowerShell@2
11+
displayName: Fully cleanup the toolcache directory before testing
12+
inputs:
13+
targetType: filePath
14+
filePath: helpers/clean-toolcache.ps1
15+
arguments: -ToolName "Python"
16+
1017
- task: DownloadPipelineArtifact@2
1118
inputs:
1219
source: 'current'
@@ -24,7 +31,7 @@ jobs:
2431
inputs:
2532
TargetType: inline
2633
script: |
27-
if ($env:PLATFORM -match 'windows') { powershell ./setup.ps1 } else { sh ./setup.sh }
34+
if ($env:PLATFORM -match 'win32') { powershell ./setup.ps1 } else { sh ./setup.sh }
2835
workingDirectory: '$(Build.BinariesDirectory)'
2936

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

4552
- task: PowerShell@2
4653
displayName: 'Verbose python binary links'
4754
inputs:
4855
TargetType: inline
4956
script: |
5057
$pythonLocation = which python
51-
if ($env:PLATFORM -match 'macos') { otool -L $pythonLocation } else { ldd $pythonLocation }
58+
if ($env:PLATFORM -match 'darwin') { otool -L $pythonLocation } else { ldd $pythonLocation }
5259
workingDirectory: '$(Build.BinariesDirectory)'
53-
condition: ne(variables['Platform'], 'windows-2016')
60+
condition: ne(variables['Platform'], 'win32')
5461

5562
- task: PowerShell@2
5663
displayName: 'Run tests'

builders/build-python.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ function Get-PythonBuilder {
5656
)
5757

5858
$Platform = $Platform.ToLower()
59-
if ($Platform -match 'windows') {
59+
if ($Platform -match 'win32') {
6060
$builder = [WinPythonBuilder]::New($Version, $Architecture, $Platform)
61-
} elseif ($Platform -match 'ubuntu') {
61+
} elseif ($Platform -match 'linux') {
6262
$builder = [UbuntuPythonBuilder]::New($Version, $Architecture, $Platform)
63-
} elseif ($Platform -match 'macos') {
63+
} elseif ($Platform -match 'darwin') {
6464
$builder = [macOSPythonBuilder]::New($Version, $Architecture, $Platform)
6565
} else {
6666
Write-Host "##vso[task.logissue type=error;] Invalid platform: $Platform"

builders/ubuntu-python-builder.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class UbuntuPythonBuilder : NixPythonBuilder {
7676
Execute-Command -Command "sudo apt install -y $_"
7777
}
7878

79-
if ($this.Platform -ne "ubuntu-1604") {
79+
if ($this.Platform -ne "linux-16.04") {
8080
### On Ubuntu-1804, libgdbm-compat-dev has older modules that are no longer in libgdbm-dev
8181
Execute-Command -Command "sudo apt install -y libgdbm-compat-dev"
8282
}

helpers

installers/map_python_platforms.json

Lines changed: 0 additions & 29 deletions
This file was deleted.

tests/clean-toolcache.ps1

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)