mirror of
https://github.com/actions/python-versions.git
synced 2025-12-12 21:48:15 +00:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user