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

Let "Use Python Version" handle prelease Python versions #6815

Merged
merged 6 commits into from
Apr 2, 2018

Conversation

brcrista
Copy link
Contributor

Python's versioning scheme is compliant with semantic versioning except for its prerelease versions.
Python: 3.7.0b2
Semantic: 3.7.0-b2

Per tool lib, the tool cache must laid out using semantic versions.
This change lets the task work if the user enters the Python-style version instead of the semantic version.

Testing:

  • L0
  • manual using the VS 2017 hosted image

@@ -31,8 +31,19 @@ interface TaskParameters {
readonly addToPath: boolean
}

export function pythonVersionToSemantic(versionSpec: string) {
const prereleaseVersion = /(\d\.\d\.\d)([a|b|rc]\d?)/g;
Copy link
Contributor

Choose a reason for hiding this comment

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

Could a, b or rc be followed multiple digits?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to the spec for valid version strings yes, but in practice nothing has ever gotten that high. I'll make it more robust just so we don't have to touch it again.

@brcrista brcrista merged commit c870d33 into master Apr 2, 2018
@brcrista brcrista deleted the users/brcrista/python-prerelease branch May 29, 2018 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants