diff --git a/release_notes.md b/release_notes.md index d84caba68..4169701de 100644 --- a/release_notes.md +++ b/release_notes.md @@ -7,6 +7,10 @@ - CLI Version: 4.3.0 - Host Runtime Version: 4.44.100 (includes 4.844.100, 4.644.100) +#### Breaking Changes + +- **Python 3.7 and 3.8 are no longer supported.** These versions have reached end-of-life. Please upgrade to Python 3.9 or later to continue using Azure Functions Core Tools. (#4756) + #### Changes - Added end-of-life warnings for all runtime versions during `func azure functionapp publish`. (#4760) diff --git a/src/Cli/func/Helpers/PythonHelpers.cs b/src/Cli/func/Helpers/PythonHelpers.cs index b7ab196f9..905fbaae7 100644 --- a/src/Cli/func/Helpers/PythonHelpers.cs +++ b/src/Cli/func/Helpers/PythonHelpers.cs @@ -183,13 +183,13 @@ public static void AssertPythonVersion(WorkerLanguageVersionInfo pythonVersion, ColoredConsole.WriteLine(VerboseColor($"Found Python version {pythonVersion.Version} ({pythonVersion.ExecutablePath}).")); } - // Python 3.[7|8|9|10|11|12] (supported) + // Python 3.[9|10|11|12] (supported) if (IsVersionSupported(pythonVersion)) { return; } - // Python 3.x (but not 3.[7|8|9|10|11|12]), not recommended, may fail. E.g.: 3.4, 3.5. + // Python 3.x (but not 3.[9|10|11|12]), not recommended, may fail. E.g.: 3.4, 3.5. if (pythonVersion.Major == 3) { if (errorIfNotSupported) @@ -234,9 +234,6 @@ public static async Task GetEnvironmentPythonVersion( // Linux / OSX / Venv Interpreter Entrypoints var python3GetVersionTask = GetVersion("python3"); var pythonGetVersionTask = GetVersion("python"); - var python36GetVersionTask = GetVersion("python3.6"); - var python37GetVersionTask = GetVersion("python3.7"); - var python38GetVersionTask = GetVersion("python3.8"); var python39GetVersionTask = GetVersion("python3.9"); var python310GetVersionTask = GetVersion("python3.10"); var python311GetVersionTask = GetVersion("python3.11"); @@ -249,9 +246,6 @@ public static async Task GetEnvironmentPythonVersion( await pyGetVersionTask, await python3GetVersionTask, await pythonGetVersionTask, - await python36GetVersionTask, - await python37GetVersionTask, - await python38GetVersionTask, await python39GetVersionTask, await python310GetVersionTask, await python311GetVersionTask, @@ -608,10 +602,6 @@ public static Task GetDockerInitFileContent(WorkerLanguageVersionInfo in { switch (info?.Minor) { - case 7: - return StaticResources.DockerfilePython37; - case 8: - return StaticResources.DockerfilePython38; case 9: return StaticResources.DockerfilePython39; case 10: @@ -627,7 +617,7 @@ public static Task GetDockerInitFileContent(WorkerLanguageVersionInfo in } } - return StaticResources.DockerfilePython37; + return StaticResources.DockerfilePython39; } // Build environment images for building native dependencies for python function apps @@ -637,12 +627,6 @@ public static Task GetDockerInitFileContent(WorkerLanguageVersionInfo in { switch (info?.Minor) { - case 6: - return (DockerImages.LinuxPython36ImageAmd64, false); - case 7: - return (DockerImages.LinuxPython37ImageAmd64, false); - case 8: - return (DockerImages.LinuxPython38ImageAmd64, false); case 9: return (DockerImages.LinuxPython39ImageAmd64, false); case 10: @@ -674,9 +658,7 @@ private static bool IsVersionSupported(WorkerLanguageVersionInfo info) case 12: case 11: case 10: - case 9: - case 8: - case 7: return true; + case 9: return true; default: return false; } } diff --git a/src/Cli/func/StaticResources/Dockerfile.python3.7 b/src/Cli/func/StaticResources/Dockerfile.python3.7 deleted file mode 100644 index a211ae36c..000000000 --- a/src/Cli/func/StaticResources/Dockerfile.python3.7 +++ /dev/null @@ -1,11 +0,0 @@ -# To enable ssh & remote debugging on app service change the base image to the one below -# FROM mcr.microsoft.com/azure-functions/python:4-python3.7-appservice -FROM mcr.microsoft.com/azure-functions/python:4-python3.7 - -ENV AzureWebJobsScriptRoot=/home/site/wwwroot \ - AzureFunctionsJobHost__Logging__Console__IsEnabled=true - -COPY requirements.txt / -RUN pip install -r /requirements.txt - -COPY . /home/site/wwwroot diff --git a/src/Cli/func/StaticResources/Dockerfile.python3.8 b/src/Cli/func/StaticResources/Dockerfile.python3.8 deleted file mode 100644 index 3d94c7ed5..000000000 --- a/src/Cli/func/StaticResources/Dockerfile.python3.8 +++ /dev/null @@ -1,11 +0,0 @@ -# To enable ssh & remote debugging on app service change the base image to the one below -# FROM mcr.microsoft.com/azure-functions/python:4-python3.8-appservice -FROM mcr.microsoft.com/azure-functions/python:4-python3.8 - -ENV AzureWebJobsScriptRoot=/home/site/wwwroot \ - AzureFunctionsJobHost__Logging__Console__IsEnabled=true - -COPY requirements.txt / -RUN pip install -r /requirements.txt - -COPY . /home/site/wwwroot diff --git a/src/Cli/func/StaticResources/StaticResources.cs b/src/Cli/func/StaticResources/StaticResources.cs index a722828c6..6638e30e9 100644 --- a/src/Cli/func/StaticResources/StaticResources.cs +++ b/src/Cli/func/StaticResources/StaticResources.cs @@ -34,10 +34,6 @@ public static class StaticResources public static Task DockerfileJava11 => GetValue("Dockerfile.java11"); - public static Task DockerfilePython37 => GetValue("Dockerfile.python3.7"); - - public static Task DockerfilePython38 => GetValue("Dockerfile.python3.8"); - public static Task DockerfilePython39 => GetValue("Dockerfile.python3.9"); public static Task DockerfilePython310 => GetValue("Dockerfile.python3.10"); diff --git a/src/Cli/func/StaticResources/StaticResources.props b/src/Cli/func/StaticResources/StaticResources.props index 675917442..51c58a142 100644 --- a/src/Cli/func/StaticResources/StaticResources.props +++ b/src/Cli/func/StaticResources/StaticResources.props @@ -58,12 +58,6 @@ $(AssemblyName).Dockerfile.powershell7.2 - - $(AssemblyName).Dockerfile.python3.7 - - - $(AssemblyName).Dockerfile.python3.8 - $(AssemblyName).Dockerfile.python3.9 diff --git a/test/Cli/Func.UnitTests/HelperTests/PythonHelperTests.cs b/test/Cli/Func.UnitTests/HelperTests/PythonHelperTests.cs index 9e603f453..42ac082a6 100644 --- a/test/Cli/Func.UnitTests/HelperTests/PythonHelperTests.cs +++ b/test/Cli/Func.UnitTests/HelperTests/PythonHelperTests.cs @@ -71,8 +71,8 @@ public void ShouldHaveMatchingLinuxFxVersion(string linuxFxVersion, int? major, [InlineData("2.7.10", true)] [InlineData("3.5.5", true)] [InlineData("3.6.8b", true)] - [InlineData("3.7.2", false)] - [InlineData("3.8.0", false)] + [InlineData("3.7.2", true)] + [InlineData("3.8.0", true)] [InlineData("3.9.0", false)] [InlineData("3.10.0", false)] [InlineData("3.11.0", false)]