Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pypy3 default version to 3.9 #16321

Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
"loc.messages.ToolNotFoundMicrosoftHosted": "If this is a Microsoft-hosted agent, check that this image supports side-by-side versions of %s at %s.",
"loc.messages.ToolNotFoundSelfHosted": "If this is a self-hosted agent, see how to configure side-by-side %s versions at %s.",
"loc.messages.VersionNotFound": "Version spec %s for architecture %s did not match any version in Agent.ToolsDirectory.",
"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`)",
"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.9`)",
"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"
}
6 changes: 3 additions & 3 deletions Tasks/UsePythonVersionV0/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"minimumAgentVersion": "2.182.1",
"version": {
"Major": 0,
"Minor": 200,
"Minor": 205,
"Patch": 0
},
"demands": [],
Expand Down Expand Up @@ -77,7 +77,7 @@
"ToolNotFoundMicrosoftHosted": "If this is a Microsoft-hosted agent, check that this image supports side-by-side versions of %s at %s.",
"ToolNotFoundSelfHosted": "If this is a self-hosted agent, see how to configure side-by-side %s versions at %s.",
"VersionNotFound": "Version spec %s for architecture %s did not match any version in Agent.ToolsDirectory.",
"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`)",
"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.9`)",
"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"
},
"restrictions": {
Expand All @@ -91,4 +91,4 @@
]
}
}
}
}
2 changes: 1 addition & 1 deletion Tasks/UsePythonVersionV0/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"minimumAgentVersion": "2.182.1",
"version": {
"Major": 0,
"Minor": 200,
"Minor": 205,
"Patch": 0
},
"demands": [],
Expand Down
10 changes: 5 additions & 5 deletions Tasks/UsePythonVersionV0/usepythonversion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function binDir(installDir: string, platform: Platform): string {
}
}

function pypyNotFoundError(versionSpec: '2' | '3.6') {
function pypyNotFoundError(versionSpec: '2' | '3.9') {
throw new Error([
task.loc('PyPyNotFound', versionSpec),
// 'Python' is intentional here
Expand All @@ -52,7 +52,7 @@ function pypyNotFoundError(versionSpec: '2' | '3.6') {
// For example, PyPy 7.0 contains Python 2.7, 3.5, and 3.6-alpha.
// We only care about the Python version, so we don't use the PyPy version for the tool cache.

function usePyPy(versionSpec: '2' | '3.6', parameters: TaskParameters, platform: Platform): void {
function usePyPy(versionSpec: '2' | '3.9', parameters: TaskParameters, platform: Platform): void {
const findPyPy = tool.findLocalTool.bind(undefined, 'PyPy', versionSpec);
let installDir: string | null = findPyPy(parameters.architecture);

Expand Down Expand Up @@ -145,9 +145,9 @@ export async function usePythonVersion(parameters: Readonly<TaskParameters>, pla
case 'PYPY2':
return usePyPy('2', parameters, platform);
case 'PYPY3':
// keep pypy3 pointing to 3.6 for backward compatibility
return usePyPy('3.6', parameters, platform);
// keep pypy3 pointing to 3.9 for backward compatibility
return usePyPy('3.9', parameters, platform);
default:
return await useCpythonVersion(parameters, platform);
}
}
}