зеркало из https://github.com/microsoft/Oryx.git
Update python 3.7 version to 3.7.3 (#44)
* Update python 3.7 version to 3.7.3 * updating image tag * Fixing tests
This commit is contained in:
Родитель
f4fe2047d5
Коммит
82f359dab8
|
@ -3,4 +3,4 @@
|
||||||
PIP_VERSION='19.0.3'
|
PIP_VERSION='19.0.3'
|
||||||
PYTHON27_VERSION='2.7.16'
|
PYTHON27_VERSION='2.7.16'
|
||||||
PYTHON36_VERSION='3.6.8'
|
PYTHON36_VERSION='3.6.8'
|
||||||
PYTHON37_VERSION='3.7.2'
|
PYTHON37_VERSION='3.7.3'
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
pip-version: 19.0.3
|
pip-version: 19.0.3
|
||||||
python27-version: 2.7.16
|
python27-version: 2.7.16
|
||||||
python36-version: 3.6.8
|
python36-version: 3.6.8
|
||||||
python37-version: 3.7.2
|
python37-version: 3.7.3
|
||||||
outputs:
|
outputs:
|
||||||
- type: csharp
|
- type: csharp
|
||||||
directory: src/BuildScriptGenerator
|
directory: src/BuildScriptGenerator
|
||||||
|
|
|
@ -210,7 +210,7 @@ ENV PYTHONIOENCODING UTF-8
|
||||||
COPY build/__python-versions.sh /tmp
|
COPY build/__python-versions.sh /tmp
|
||||||
COPY --from=mcr.microsoft.com/oryx/python-build-2.7:20190322.1 /opt /opt
|
COPY --from=mcr.microsoft.com/oryx/python-build-2.7:20190322.1 /opt /opt
|
||||||
COPY --from=mcr.microsoft.com/oryx/python-build-3.6:20190322.1 /opt /opt
|
COPY --from=mcr.microsoft.com/oryx/python-build-3.6:20190322.1 /opt /opt
|
||||||
COPY --from=mcr.microsoft.com/oryx/python-build-3.7:20190322.1 /opt /opt
|
COPY --from=mcr.microsoft.com/oryx/python-build-3.7:20190402.1 /opt /opt
|
||||||
RUN . /tmp/__python-versions.sh && set -ex \
|
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/$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/$PYTHON36_VERSION" ] && echo /opt/python/$PYTHON36_VERSION/lib >> /etc/ld.so.conf.d/python.conf \
|
||||||
|
|
|
@ -7,16 +7,19 @@
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
declare -r DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
|
declare -r DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
|
||||||
|
declare -r PYTHON_VERSIONS_PATH=$DIR/../../../build/__python-versions.sh
|
||||||
declare -r VERSIONS_FILE="$DIR/pythonVersions.txt"
|
declare -r VERSIONS_FILE="$DIR/pythonVersions.txt"
|
||||||
declare -r DOCKERFILE_TEMPLATE="$DIR/Dockerfile.template"
|
declare -r DOCKERFILE_TEMPLATE="$DIR/Dockerfile.template"
|
||||||
declare -r IMAGE_NAME_PLACEHOLDER="%PYTHON_BASE_IMAGE%"
|
declare -r IMAGE_NAME_PLACEHOLDER="%PYTHON_BASE_IMAGE%"
|
||||||
declare -r ALPINE_OR_STRETCH_PLACEHOLDER="%PYTHON_BASE_IMAGE_ALPINE_OR_STRETCH%"
|
declare -r ALPINE_OR_STRETCH_PLACEHOLDER="%PYTHON_BASE_IMAGE_ALPINE_OR_STRETCH%"
|
||||||
|
declare -r IMAGE_SUFFIX="-slim-stretch"
|
||||||
|
|
||||||
# Example line:
|
source "$PYTHON_VERSIONS_PATH"
|
||||||
# 8.11.4-alpine
|
while IFS= read -r PYTHON_VERSION_VAR_NAME || [[ -n $PYTHON_VERSION_VAR_NAME ]]
|
||||||
while IFS= read -r PYTHON_IMAGE_NAME || [[ -n $PYTHON_IMAGE_NAME ]]
|
|
||||||
do
|
do
|
||||||
IFS='.' read -ra SPLIT_VERSION <<< "$PYTHON_IMAGE_NAME"
|
PYTHON_VERSION=${!PYTHON_VERSION_VAR_NAME}
|
||||||
|
PYTHON_IMAGE_NAME=$PYTHON_VERSION$IMAGE_SUFFIX
|
||||||
|
IFS='.' read -ra SPLIT_VERSION <<< "$PYTHON_VERSION"
|
||||||
VERSION_DIRECTORY="${SPLIT_VERSION[0]}.${SPLIT_VERSION[1]}"
|
VERSION_DIRECTORY="${SPLIT_VERSION[0]}.${SPLIT_VERSION[1]}"
|
||||||
echo "Generating Dockerfile for image '$PYTHON_IMAGE_NAME' in directory '$VERSION_DIRECTORY'..."
|
echo "Generating Dockerfile for image '$PYTHON_IMAGE_NAME' in directory '$VERSION_DIRECTORY'..."
|
||||||
|
|
||||||
|
@ -33,4 +36,4 @@ do
|
||||||
# Replace placeholders
|
# Replace placeholders
|
||||||
sed -i "s|$IMAGE_NAME_PLACEHOLDER|$PYTHON_IMAGE_NAME|g" "$TARGET_DOCKERFILE"
|
sed -i "s|$IMAGE_NAME_PLACEHOLDER|$PYTHON_IMAGE_NAME|g" "$TARGET_DOCKERFILE"
|
||||||
sed -i "s|$ALPINE_OR_STRETCH_PLACEHOLDER|$GO_IMAGE_TYPE|g" "$TARGET_DOCKERFILE"
|
sed -i "s|$ALPINE_OR_STRETCH_PLACEHOLDER|$GO_IMAGE_TYPE|g" "$TARGET_DOCKERFILE"
|
||||||
done < "$VERSIONS_FILE"
|
done < <(compgen -A variable | grep 'PYTHON[0-9]\{2,\}_VERSION')
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
2.7.15-slim-stretch
|
|
||||||
3.6.7-slim-stretch
|
|
||||||
3.7.2-slim-stretch
|
|
|
@ -7,6 +7,6 @@ namespace Microsoft.Oryx.Common
|
||||||
public const string PipVersion = "19.0.3";
|
public const string PipVersion = "19.0.3";
|
||||||
public const string Python27Version = "2.7.16";
|
public const string Python27Version = "2.7.16";
|
||||||
public const string Python36Version = "3.6.8";
|
public const string Python36Version = "3.6.8";
|
||||||
public const string Python37Version = "3.7.2";
|
public const string Python37Version = "3.7.3";
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -2,9 +2,7 @@
|
||||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
// Licensed under the MIT license.
|
// Licensed under the MIT license.
|
||||||
// --------------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using Microsoft.Oryx.Tests.Common;
|
using Microsoft.Oryx.Tests.Common;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
using Xunit.Abstractions;
|
using Xunit.Abstractions;
|
||||||
|
@ -29,7 +27,7 @@ namespace Microsoft.Oryx.RuntimeImage.Tests
|
||||||
var expectedOryxVersion = string.Concat(Settings.OryxVersion, buildNumber);
|
var expectedOryxVersion = string.Concat(Settings.OryxVersion, buildNumber);
|
||||||
|
|
||||||
// we cant always rely on gitcommitid as env variable in case build context is not correctly passed
|
// we cant always rely on gitcommitid as env variable in case build context is not correctly passed
|
||||||
// so we should check agent_os environment variable to know if the build is happening in azure devops agent
|
// so we should check agent_os environment variable to know if the build is happening in azure devops agent
|
||||||
// or locally, locally we need to skip this test
|
// or locally, locally we need to skip this test
|
||||||
Skip.If(string.IsNullOrEmpty(agentOS));
|
Skip.If(string.IsNullOrEmpty(agentOS));
|
||||||
// Act
|
// Act
|
||||||
|
@ -51,7 +49,7 @@ namespace Microsoft.Oryx.RuntimeImage.Tests
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
[InlineData("3.6", "Python " + Settings.Python36Version)]
|
[InlineData("3.6", "Python " + Common.PythonVersions.Python36Version)]
|
||||||
[InlineData("3.7", "Python " + Common.PythonVersions.Python37Version)]
|
[InlineData("3.7", "Python " + Common.PythonVersions.Python37Version)]
|
||||||
public void PythonVersionMatchesImageName(string pythonVersion, string expectedOutput)
|
public void PythonVersionMatchesImageName(string pythonVersion, string expectedOutput)
|
||||||
{
|
{
|
||||||
|
@ -76,7 +74,7 @@ namespace Microsoft.Oryx.RuntimeImage.Tests
|
||||||
public void Python2MatchesImageName()
|
public void Python2MatchesImageName()
|
||||||
{
|
{
|
||||||
string pythonVersion = "2.7";
|
string pythonVersion = "2.7";
|
||||||
string expectedOutput = "Python " + Settings.Python27Version;
|
string expectedOutput = "Python " + Common.PythonVersions.Python27Version;
|
||||||
|
|
||||||
// Arrange & Act
|
// Arrange & Act
|
||||||
var result = _dockerCli.Run(
|
var result = _dockerCli.Run(
|
||||||
|
@ -90,7 +88,7 @@ namespace Microsoft.Oryx.RuntimeImage.Tests
|
||||||
() =>
|
() =>
|
||||||
{
|
{
|
||||||
Assert.True(result.IsSuccess);
|
Assert.True(result.IsSuccess);
|
||||||
//bugs.python.org >> issue18338 weird but true, earlier than python 3.4
|
//bugs.python.org >> issue18338 weird but true, earlier than python 3.4
|
||||||
// sends python --version output to STDERR
|
// sends python --version output to STDERR
|
||||||
Assert.Equal(expectedOutput, actualOutput);
|
Assert.Equal(expectedOutput, actualOutput);
|
||||||
},
|
},
|
||||||
|
@ -112,9 +110,9 @@ namespace Microsoft.Oryx.RuntimeImage.Tests
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
var res = _dockerCli.Run("oryxdevms/python-3.7", "/bin/sh", new[] { "-c", script });
|
var res = _dockerCli.Run("oryxdevms/python-3.7", "/bin/sh", new[] { "-c", script });
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
RunAsserts(() => Assert.Equal(res.ExitCode, exitCodeSentinel), res.GetDebugInfo());
|
RunAsserts(() => Assert.Equal(res.ExitCode, exitCodeSentinel), res.GetDebugInfo());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -6,8 +6,6 @@ namespace Microsoft.Oryx.RuntimeImage.Tests
|
||||||
{
|
{
|
||||||
internal class Settings
|
internal class Settings
|
||||||
{
|
{
|
||||||
public const string Python27Version = "2.7.15";
|
|
||||||
public const string Python36Version = "3.6.7";
|
|
||||||
public const string OryxVersion = "0.2.";
|
public const string OryxVersion = "0.2.";
|
||||||
}
|
}
|
||||||
}
|
}
|
Загрузка…
Ссылка в новой задаче