From b6e351bd3bec5b7783d53c69ef957b3688de5f75 Mon Sep 17 00:00:00 2001 From: Dor Date: Thu, 20 Jun 2019 16:02:20 -0700 Subject: [PATCH] Fixed Python 3.8 directory discovery (#217) --- images/build/Dockerfile | 3 +++ src/BuildScriptGenerator/VersionProviderHelpers.cs | 7 +++---- src/BuildScriptGeneratorCli/Commands/BuildCommand.cs | 2 +- src/BuildScriptGeneratorCli/Commands/BuildScriptCommand.cs | 2 +- .../Commands/BuildpackBuildCommand.cs | 3 +-- .../Commands/BuildpackDetectCommand.cs | 4 ++-- .../Commands/InstallRunTimeCommand.cs | 2 +- src/BuildScriptGeneratorCli/Commands/LanguagesCommand.cs | 3 +-- src/BuildScriptGeneratorCli/Commands/RunScriptCommand.cs | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/images/build/Dockerfile b/images/build/Dockerfile index ebecbb4d4..24854082d 100644 --- a/images/build/Dockerfile +++ b/images/build/Dockerfile @@ -298,13 +298,16 @@ RUN . /tmp/__python-versions.sh && set -ex \ && [ -d "/opt/python/$PYTHON27_VERSION" ] && echo /opt/python/$PYTHON27_VERSION/lib >> /etc/ld.so.conf.d/python.conf \ && [ -d "/opt/python/$PYTHON36_VERSION" ] && echo /opt/python/$PYTHON36_VERSION/lib >> /etc/ld.so.conf.d/python.conf \ && [ -d "/opt/python/$PYTHON37_VERSION" ] && echo /opt/python/$PYTHON37_VERSION/lib >> /etc/ld.so.conf.d/python.conf \ + && [ -d "/opt/python/$PYTHON38_VERSION" ] && echo /opt/python/$PYTHON38_VERSION/lib >> /etc/ld.so.conf.d/python.conf \ && ldconfig +# The link from PYTHON38_VERSION to 3.8.0 exists because "3.8.0b1" isn't a valid SemVer string. RUN . /tmp/__python-versions.sh && set -ex \ && ln -s $PYTHON27_VERSION /opt/python/2.7 \ && ln -s 2.7 /opt/python/2 \ && ln -s $PYTHON36_VERSION /opt/python/3.6 \ && ln -s $PYTHON37_VERSION /opt/python/latest \ && ln -s $PYTHON37_VERSION /opt/python/3.7 \ + && ln -s $PYTHON38_VERSION /opt/python/3.8.0 \ && ln -s $PYTHON38_VERSION /opt/python/3.8 \ && ln -s 3.7 /opt/python/3 RUN set -ex \ diff --git a/src/BuildScriptGenerator/VersionProviderHelpers.cs b/src/BuildScriptGenerator/VersionProviderHelpers.cs index 895ace1b0..6a427a844 100644 --- a/src/BuildScriptGenerator/VersionProviderHelpers.cs +++ b/src/BuildScriptGenerator/VersionProviderHelpers.cs @@ -2,6 +2,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. // -------------------------------------------------------------------------------------------- + using System; using System.Collections.Generic; using System.IO; @@ -22,10 +23,8 @@ namespace Microsoft.Oryx.BuildScriptGenerator IEnumerable versionDirectories; try { - versionDirectories = Directory.EnumerateDirectories( - versionsDir, - "*", - listOptions).Select(versionDir => new DirectoryInfo(versionDir)); + versionDirectories = Directory.EnumerateDirectories(versionsDir, "*", listOptions) + .Select(versionDir => new DirectoryInfo(versionDir)); } catch (IOException) { diff --git a/src/BuildScriptGeneratorCli/Commands/BuildCommand.cs b/src/BuildScriptGeneratorCli/Commands/BuildCommand.cs index 92a11f443..0c1542c3d 100644 --- a/src/BuildScriptGeneratorCli/Commands/BuildCommand.cs +++ b/src/BuildScriptGeneratorCli/Commands/BuildCommand.cs @@ -19,7 +19,7 @@ using Microsoft.Oryx.Common; namespace Microsoft.Oryx.BuildScriptGeneratorCli { - [Command(BuildCommand.Name, Description = "Build an app.")] + [Command(Name, Description = "Build an app.")] internal class BuildCommand : CommandBase { public const string Name = "build"; diff --git a/src/BuildScriptGeneratorCli/Commands/BuildScriptCommand.cs b/src/BuildScriptGeneratorCli/Commands/BuildScriptCommand.cs index 6b60e8dbc..4c6530063 100644 --- a/src/BuildScriptGeneratorCli/Commands/BuildScriptCommand.cs +++ b/src/BuildScriptGeneratorCli/Commands/BuildScriptCommand.cs @@ -13,7 +13,7 @@ using Microsoft.Oryx.Common; namespace Microsoft.Oryx.BuildScriptGeneratorCli { - [Command(BuildScriptCommand.Name, Description = "Generate build script to standard output.")] + [Command(Name, Description = "Generate build script to standard output.")] internal class BuildScriptCommand : CommandBase { public const string Name = "build-script"; diff --git a/src/BuildScriptGeneratorCli/Commands/BuildpackBuildCommand.cs b/src/BuildScriptGeneratorCli/Commands/BuildpackBuildCommand.cs index 3102e318a..5a237b965 100644 --- a/src/BuildScriptGeneratorCli/Commands/BuildpackBuildCommand.cs +++ b/src/BuildScriptGeneratorCli/Commands/BuildpackBuildCommand.cs @@ -11,8 +11,7 @@ using Microsoft.Extensions.Logging; namespace Microsoft.Oryx.BuildScriptGeneratorCli { - [Command(BuildpackBuildCommand.Name, Description = "Build an app in the current working directory " + - "(for use in a Buildpack).")] + [Command(Name, Description = "Build an app in the current working directory (for use in a Buildpack).")] internal class BuildpackBuildCommand : BuildCommand { public new const string Name = "buildpack-build"; diff --git a/src/BuildScriptGeneratorCli/Commands/BuildpackDetectCommand.cs b/src/BuildScriptGeneratorCli/Commands/BuildpackDetectCommand.cs index ca5cd7241..f04fa8af3 100644 --- a/src/BuildScriptGeneratorCli/Commands/BuildpackDetectCommand.cs +++ b/src/BuildScriptGeneratorCli/Commands/BuildpackDetectCommand.cs @@ -15,8 +15,8 @@ using Microsoft.Oryx.Common; namespace Microsoft.Oryx.BuildScriptGeneratorCli { - [Command(BuildpackDetectCommand.Name, Description = "Determine whether Oryx can be applied as a buildpack to " + - "an app in the current working directory.")] + [Command(Name, Description = "Determine whether Oryx can be applied as a buildpack to an app in the current " + + "working directory.")] internal class BuildpackDetectCommand : CommandBase { public const string Name = "buildpack-detect"; diff --git a/src/BuildScriptGeneratorCli/Commands/InstallRunTimeCommand.cs b/src/BuildScriptGeneratorCli/Commands/InstallRunTimeCommand.cs index aaf5fc7e9..38965a080 100644 --- a/src/BuildScriptGeneratorCli/Commands/InstallRunTimeCommand.cs +++ b/src/BuildScriptGeneratorCli/Commands/InstallRunTimeCommand.cs @@ -12,7 +12,7 @@ using Microsoft.Oryx.Common; namespace Microsoft.Oryx.BuildScriptGeneratorCli { - [Command(InstallRunTimeCommand.Name, Description = "Install the required runtime components for a platform.")] + [Command(Name, Description = "Install the required runtime components for a platform.")] internal class InstallRunTimeCommand : CommandBase { public const string Name = "install-runtime"; diff --git a/src/BuildScriptGeneratorCli/Commands/LanguagesCommand.cs b/src/BuildScriptGeneratorCli/Commands/LanguagesCommand.cs index ff64aaedd..256df555a 100644 --- a/src/BuildScriptGeneratorCli/Commands/LanguagesCommand.cs +++ b/src/BuildScriptGeneratorCli/Commands/LanguagesCommand.cs @@ -16,8 +16,7 @@ using Newtonsoft.Json; namespace Microsoft.Oryx.BuildScriptGeneratorCli { - [Command(LanguagesCommand.Name, Description = "Show the list of supported platforms and other information " + - "like versions, properties etc.")] + [Command(Name, Description = "Show a list of supported platforms along with their versions and build properties.")] internal class LanguagesCommand : CommandBase { public const string Name = "languages"; diff --git a/src/BuildScriptGeneratorCli/Commands/RunScriptCommand.cs b/src/BuildScriptGeneratorCli/Commands/RunScriptCommand.cs index 4f6bc4f22..a5a89088d 100644 --- a/src/BuildScriptGeneratorCli/Commands/RunScriptCommand.cs +++ b/src/BuildScriptGeneratorCli/Commands/RunScriptCommand.cs @@ -13,7 +13,7 @@ using Microsoft.Oryx.Common; namespace Microsoft.Oryx.BuildScriptGeneratorCli { - [Command(RunScriptCommand.Name, Description = "Generate startup script.", + [Command(Name, Description = "Generate startup script.", ThrowOnUnexpectedArgument = false, AllowArgumentSeparator = true)] internal class RunScriptCommand : CommandBase {