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

@@ -33,13 +33,12 @@ class NixPythonBuilder : PythonBuilder {
[string] $OutputArtifactName
NixPythonBuilder(
[version] $version,
[semver] $version,
[string] $architecture,
[string] $platform
) : Base($version, $architecture, $platform) {
$this.InstallationTemplateName = "nix-setup-template.sh"
$this.InstallationScriptName = "setup.sh"
$this.OutputArtifactName = "python-$Version-$Platform-$Architecture.tar.gz"
}
@@ -50,8 +49,10 @@ class NixPythonBuilder : PythonBuilder {
#>
$base = $this.GetBaseUri()
$versionName = $this.GetBaseVersion()
$nativeVersion = Convert-Version -version $this.Version
return "${base}/$($this.Version)/Python-$($this.Version).tgz"
return "${base}/${versionName}/Python-${nativeVersion}.tgz"
}
[string] GetPythonBinary() {
@@ -95,9 +96,7 @@ class NixPythonBuilder : PythonBuilder {
$installationTemplateContent = Get-Content -Path $installationTemplateLocation -Raw
$variablesToReplace = @{
"{{__VERSION_MAJOR__}}" = $this.Version.Major;
"{{__VERSION_MINOR__}}" = $this.Version.Minor;
"{{__VERSION_BUILD__}}" = $this.Version.Build;
"{{__VERSION_FULL__}}" = $this.Version;
}
$variablesToReplace.keys | ForEach-Object { $installationTemplateContent = $installationTemplateContent.Replace($_, $variablesToReplace[$_]) }