-
Notifications
You must be signed in to change notification settings - Fork 522
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
Add support to .tool-version file format #588
base: main
Are you sure you want to change the base?
Conversation
Hello @elpic! |
Would it be possible for you @dmitry-shibanov to run the failing tests? |
let pythonVersion: string | undefined; | ||
|
||
// Try to find the version in tool-version file | ||
const found = contents.match(/^(?:python\s+)?v?(?<version>[^\s]+)$/m); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that the regular expression we used in line 34 won't work with PyPy
versions correctly. In the .tool-version
, PyPy format doesn't have v
: python pypy3.9-3.7.11
, but the action's python-version
input should include v
before the PyPy version: python pypy3.9-v3.7.11
. I think we can adapt the matched version of PyPy (basically just add v
before the PyPy version) and add some e2e tests both for Python and PyPy installation from .tool-version
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I saw from pypy version of python in asdf-vm you have the following version
python pypy3.9-3.7.11
Is that not correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's correct version syntax for .tool-version
file, but incorrect python-version
syntax for setup-python. Check the supported syntax here and, please, pay attention to the letter v
.
.tool-version content | your regex result | setup-python requirement |
---|---|---|
python pypy3.9-3.7.11 | pypy3.9-3.7.11 | pypy3.9-v3.7.11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@elpic may be could add a if/else condition here https://github.com/actions/setup-python/pull/588/files#diff-0ac8bdebd0ca13af3640499ecf1203abc825161011f13f9ca45c734bfe80128eR51 so that we parse format only for .tool-verions file
Hello @elpic, just a gentle ping. |
1 similar comment
Hello @elpic, just a gentle ping. |
Sorry I will take a look in a moment |
Any chance this gets reviewed soon? |
Looks like there are a few checks failing that need addressed. @elpic any chance you have time to turn this PR green? 😅 |
Create a function to parse tool-version (asdf-vm) format, add the associated tests, and updated the documentation Ticket-ID: actions#571
Rollback a not abot advanced usage on how to use the file and not use the GITHUB_WORKSPACE since it was removed in a previous PR
Build the project using `npm run build` and run prettier using `npm run format`
Sorry for the delay. The code is formatted now |
@elpic this is a great improvement for this action 👏 |
Can we get this merged? |
Create a function to parse tool-version (asdf-vm) format, add the associated tests, and updated the documentation
Ticket-ID: #571
Description:
Create a function to parse tool-version (asdf-vm) format, add the associated tests, and updated the documentation
Related issue:
#571
Check list: