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:
Gabriel Castro 2019-04-04 09:40:49 -07:00 коммит произвёл GitHub
Родитель f4fe2047d5
Коммит 82f359dab8
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
8 изменённых файлов: 18 добавлений и 22 удалений

Просмотреть файл

@ -3,4 +3,4 @@
PIP_VERSION='19.0.3'
PYTHON27_VERSION='2.7.16'
PYTHON36_VERSION='3.6.8'
PYTHON37_VERSION='3.7.2'
PYTHON37_VERSION='3.7.3'

Просмотреть файл

@ -28,7 +28,7 @@
pip-version: 19.0.3
python27-version: 2.7.16
python36-version: 3.6.8
python37-version: 3.7.2
python37-version: 3.7.3
outputs:
- type: csharp
directory: src/BuildScriptGenerator

Просмотреть файл

@ -210,7 +210,7 @@ ENV PYTHONIOENCODING UTF-8
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-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 \
&& [ -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 \

Просмотреть файл

@ -7,16 +7,19 @@
set -e
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 DOCKERFILE_TEMPLATE="$DIR/Dockerfile.template"
declare -r IMAGE_NAME_PLACEHOLDER="%PYTHON_BASE_IMAGE%"
declare -r ALPINE_OR_STRETCH_PLACEHOLDER="%PYTHON_BASE_IMAGE_ALPINE_OR_STRETCH%"
declare -r IMAGE_SUFFIX="-slim-stretch"
# Example line:
# 8.11.4-alpine
while IFS= read -r PYTHON_IMAGE_NAME || [[ -n $PYTHON_IMAGE_NAME ]]
source "$PYTHON_VERSIONS_PATH"
while IFS= read -r PYTHON_VERSION_VAR_NAME || [[ -n $PYTHON_VERSION_VAR_NAME ]]
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]}"
echo "Generating Dockerfile for image '$PYTHON_IMAGE_NAME' in directory '$VERSION_DIRECTORY'..."
@ -33,4 +36,4 @@ do
# Replace placeholders
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"
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 Python27Version = "2.7.16";
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.
// Licensed under the MIT license.
// --------------------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using Microsoft.Oryx.Tests.Common;
using Xunit;
using Xunit.Abstractions;
@ -29,7 +27,7 @@ namespace Microsoft.Oryx.RuntimeImage.Tests
var expectedOryxVersion = string.Concat(Settings.OryxVersion, buildNumber);
// 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
Skip.If(string.IsNullOrEmpty(agentOS));
// Act
@ -51,7 +49,7 @@ namespace Microsoft.Oryx.RuntimeImage.Tests
}
[Theory]
[InlineData("3.6", "Python " + Settings.Python36Version)]
[InlineData("3.6", "Python " + Common.PythonVersions.Python36Version)]
[InlineData("3.7", "Python " + Common.PythonVersions.Python37Version)]
public void PythonVersionMatchesImageName(string pythonVersion, string expectedOutput)
{
@ -76,7 +74,7 @@ namespace Microsoft.Oryx.RuntimeImage.Tests
public void Python2MatchesImageName()
{
string pythonVersion = "2.7";
string expectedOutput = "Python " + Settings.Python27Version;
string expectedOutput = "Python " + Common.PythonVersions.Python27Version;
// Arrange & Act
var result = _dockerCli.Run(
@ -90,7 +88,7 @@ namespace Microsoft.Oryx.RuntimeImage.Tests
() =>
{
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
Assert.Equal(expectedOutput, actualOutput);
},
@ -112,9 +110,9 @@ namespace Microsoft.Oryx.RuntimeImage.Tests
// Act
var res = _dockerCli.Run("oryxdevms/python-3.7", "/bin/sh", new[] { "-c", script });
// Assert
RunAsserts(() => Assert.Equal(res.ExitCode, exitCodeSentinel), res.GetDebugInfo());
}
}
}
}

Просмотреть файл

@ -6,8 +6,6 @@ namespace Microsoft.Oryx.RuntimeImage.Tests
{
internal class Settings
{
public const string Python27Version = "2.7.15";
public const string Python36Version = "3.6.7";
public const string OryxVersion = "0.2.";
}
}