Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add support for .tool-versions file in setup-python #1043

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

Merged
Prev Previous commit
Next Next commit
update regex
  • Loading branch information
mahabaleshwars committed Feb 27, 2025
commit 80c5969e70af2c2115eb4c2fdcd580ef82ada867
2 changes: 1 addition & 1 deletion 2 dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100694,7 +100694,7 @@ function getVersionInputFromToolVersions(versionFile) {
if (line.trim().startsWith('#')) {
continue;
}
const match = line.match(/^\s*python\s*v?(?<version>[^\s]+(?:\s*[-<>=!]+[^\s]+)*)\s*(-\s([^\s].*))?\s*$/);
const match = line.match(/^\s*python\s*v?\s*(?<version>[^\s]+)\s*$/);
if (match) {
return [((_a = match.groups) === null || _a === void 0 ? void 0 : _a.version.trim()) || ''];
}
Expand Down
4 changes: 1 addition & 3 deletions 4 src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,7 @@ export function getVersionInputFromToolVersions(versionFile: string): string[] {
if (line.trim().startsWith('#')) {
continue;
}
const match = line.match(
/^\s*python\s*v?(?<version>[^\s]+(?:\s*[-<>=!]+[^\s]+)*)\s*(-\s([^\s].*))?\s*$/
);
const match = line.match(/^\s*python\s*v?\s*(?<version>[^\s]+)\s*$/);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nit: the [^\s] can be replaced with just \S

if (match) {
return [match.groups?.version.trim() || ''];
}
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.