Add support for unstable Python versions (#38)

* Add support of unstable versions to package generation (#2)
* Add support of symver versions to Python setup scripts and tests

Co-authored-by: Maksim Petrov <47208721+vmapetr@users.noreply.github.com>
Co-authored-by: MaksimZhukov <v-mazhuk@microsoft.com>
Co-authored-by: Maxim Lobanov <v-malob@microsoft.com>
This commit is contained in:
MaksimZhukov
2020-07-15 13:13:21 +03:00
committed by GitHub
parent 67794a4d5f
commit 5c851d6172
17 changed files with 193 additions and 74 deletions

View File

@@ -29,7 +29,7 @@ class PythonBuilder {
#>
[version] $Version
[semver] $Version
[string] $Architecture
[string] $Platform
[string] $HostedToolcacheLocation
@@ -38,17 +38,17 @@ class PythonBuilder {
[string] $ArtifactFolderLocation
[string] $InstallationTemplatesLocation
PythonBuilder ([version] $version, [string] $architecture, [string] $platform) {
$this.Version = $version
$this.Architecture = $architecture
$this.Platform = $platform
PythonBuilder ([semver] $version, [string] $architecture, [string] $platform) {
$this.InstallationTemplatesLocation = Join-Path -Path $PSScriptRoot -ChildPath "../installers"
$this.HostedToolcacheLocation = $env:AGENT_TOOLSDIRECTORY
$this.TempFolderLocation = $env:BUILD_SOURCESDIRECTORY
$this.WorkFolderLocation = $env:BUILD_BINARIESDIRECTORY
$this.ArtifactFolderLocation = $env:BUILD_STAGINGDIRECTORY
$this.InstallationTemplatesLocation = Join-Path -Path $PSScriptRoot -ChildPath "../installers"
$this.Version = $version
$this.Architecture = $architecture
$this.Platform = $platform
}
[uri] GetBaseUri() {
@@ -79,11 +79,21 @@ class PythonBuilder {
return "$pythonToolcacheLocation/$($this.Version)/$($this.Architecture)"
}
[string] GetBaseVersion() {
<#
.SYNOPSIS
Return Major.Minor.Patch version string.
#>
return "$($this.Version.Major).$($this.Version.Minor).$($this.Version.Patch)"
}
[void] PreparePythonToolcacheLocation() {
<#
.SYNOPSIS
Prepare system hostedtoolcache folder for new Python version.
#>
$pythonBinariesLocation = $this.GetFullPythonToolcacheLocation()
if (Test-Path $pythonBinariesLocation) {