Add support to .tool-version file format#588
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.
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.
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.
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.
@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? |
|
This would be a great addition. |
|
Another +1 for merging this 🙏 |
|
I'd love to have this merged 🙏 |
|
Hello @elpic, |
|
Hi @elpic, |
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: