Skip to content

Commit 15d90de

Browse files
author
Ivan Golubev
authored
Backporting required changes to the release branch (#15612)
* Add the warning when using python version 3.5 (#15609) * Add warning when use python version is 3.5 * Bump version * Change warning message * Bump version to 2.197.0
1 parent e8bd003 commit 15d90de

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

Tasks/UsePythonVersionV0/Strings/resources.resjson/en-US/resources.resjson

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@
1717
"loc.messages.ToolNotFoundMicrosoftHosted": "If this is a Microsoft-hosted agent, check that this image supports side-by-side versions of %s at %s.",
1818
"loc.messages.ToolNotFoundSelfHosted": "If this is a self-hosted agent, see how to configure side-by-side %s versions at %s.",
1919
"loc.messages.VersionNotFound": "Version spec %s for architecture %s did not match any version in Agent.ToolsDirectory.",
20-
"loc.messages.ExactVersionNotRecommended": "Specifying an exact version is not recommended on Microsoft-Hosted agents. Patch versions of Python can be replaced by new ones on Hosted agents without notice, which will cause builds to fail unexpectedly. It is recommended to specify only major or major and minor version (Example: `3` or `3.6`)"
20+
"loc.messages.ExactVersionNotRecommended": "Specifying an exact version is not recommended on Microsoft-Hosted agents. Patch versions of Python can be replaced by new ones on Hosted agents without notice, which will cause builds to fail unexpectedly. It is recommended to specify only major or major and minor version (Example: `3` or `3.6`)",
21+
"loc.messages.PythonVersionRetirement": "Python 3.5 has reached its end of life and will be removed from the ms-hosted images on January, 24. Please update Python version if you use ms-hosted agents. For more information about this - https://github.com/actions/virtual-environments"
2122
}

Tasks/UsePythonVersionV0/task.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"minimumAgentVersion": "2.182.1",
1515
"version": {
1616
"Major": 0,
17-
"Minor": 193,
17+
"Minor": 197,
1818
"Patch": 0
1919
},
2020
"demands": [],
@@ -77,7 +77,8 @@
7777
"ToolNotFoundMicrosoftHosted": "If this is a Microsoft-hosted agent, check that this image supports side-by-side versions of %s at %s.",
7878
"ToolNotFoundSelfHosted": "If this is a self-hosted agent, see how to configure side-by-side %s versions at %s.",
7979
"VersionNotFound": "Version spec %s for architecture %s did not match any version in Agent.ToolsDirectory.",
80-
"ExactVersionNotRecommended": "Specifying an exact version is not recommended on Microsoft-Hosted agents. Patch versions of Python can be replaced by new ones on Hosted agents without notice, which will cause builds to fail unexpectedly. It is recommended to specify only major or major and minor version (Example: `3` or `3.6`)"
80+
"ExactVersionNotRecommended": "Specifying an exact version is not recommended on Microsoft-Hosted agents. Patch versions of Python can be replaced by new ones on Hosted agents without notice, which will cause builds to fail unexpectedly. It is recommended to specify only major or major and minor version (Example: `3` or `3.6`)",
81+
"PythonVersionRetirement": "Python 3.5 has reached its end of life and will be removed from the ms-hosted images on January, 24. Please update Python version if you use ms-hosted agents. For more information about this - https://github.com/actions/virtual-environments"
8182
},
8283
"restrictions": {
8384
"commands": {

Tasks/UsePythonVersionV0/task.loc.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"minimumAgentVersion": "2.182.1",
1515
"version": {
1616
"Major": 0,
17-
"Minor": 193,
17+
"Minor": 197,
1818
"Patch": 0
1919
},
2020
"demands": [],
@@ -77,7 +77,8 @@
7777
"ToolNotFoundMicrosoftHosted": "ms-resource:loc.messages.ToolNotFoundMicrosoftHosted",
7878
"ToolNotFoundSelfHosted": "ms-resource:loc.messages.ToolNotFoundSelfHosted",
7979
"VersionNotFound": "ms-resource:loc.messages.VersionNotFound",
80-
"ExactVersionNotRecommended": "ms-resource:loc.messages.ExactVersionNotRecommended"
80+
"ExactVersionNotRecommended": "ms-resource:loc.messages.ExactVersionNotRecommended",
81+
"PythonVersionRetirement": "ms-resource:loc.messages.PythonVersionRetirement"
8182
},
8283
"restrictions": {
8384
"commands": {

Tasks/UsePythonVersionV0/usepythonversion.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ async function useCpythonVersion(parameters: Readonly<TaskParameters>, platform:
9090
const semanticVersionSpec = pythonVersionToSemantic(desugaredVersionSpec);
9191
task.debug(`Semantic version spec of ${parameters.versionSpec} is ${semanticVersionSpec}`);
9292

93+
// Throw warning if Python version is 3.5
94+
if (semver.satisfies(semver.coerce(parameters.versionSpec), "3.5.*")) {
95+
task.warning(task.loc('PythonVersionRetirement'));
96+
}
97+
9398
if (isExactVersion(semanticVersionSpec)) {
9499
task.warning(task.loc('ExactVersionNotRecommended'));
95100
}

0 commit comments

Comments
 (0)