FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add support to .tool-version file format by elpic · Pull Request #588 · actions/setup-python · GitHub

Add support to .tool-version file format - #588

Closed
elpic wants to merge 3 commits into
actions:mainfrom
elpic:main
Closed

Add support to .tool-version file format#588
elpic wants to merge 3 commits into
actions:mainfrom
elpic:main

Conversation

elpic commented Jan 17, 2023

Copy link
Copy Markdown

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:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

elpic requested a review from a team as a code owner January 17, 2023 21:36

Copy link
Copy Markdown
Contributor

Hello @elpic!
Thanks for your contribution! Some workflows failed, let's try to complete them.
Could you please run the format and build commands?

Comment thread src/setup-python.ts Outdated
Comment thread docs/advanced-usage.md Outdated
elpic requested a review from dmitry-shibanov January 18, 2023 11:23
Comment thread docs/advanced-usage.md Outdated
elpic requested a review from dmitry-shibanov January 18, 2023 13:02

elpic commented Jan 20, 2023

Copy link
Copy Markdown
Author

Would it be possible for you @dmitry-shibanov to run the failing tests?

Comment thread src/utils.ts
let pythonVersion: string | undefined;

// Try to find the version in tool-version file
const found = contents.match(/^(?:python\s+)?v?(?<version>[^\s]+)$/m);

IvanZosimov Jan 31, 2023
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@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

Copy link
Copy Markdown
Contributor

Hello @elpic, just a gentle ping.

1 similar comment

Copy link
Copy Markdown
Contributor

Hello @elpic, just a gentle ping.

elpic commented Mar 14, 2023

Copy link
Copy Markdown
Author

Sorry I will take a look in a moment

plukevdh commented Apr 8, 2023

Copy link
Copy Markdown

Any chance this gets reviewed soon?

camflan commented May 19, 2023

Copy link
Copy Markdown

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? 😅

elpic added 3 commits May 31, 2023 09:02
Create a function to parse tool-version (asdf-vm) format, add the
associated tests, and updated the documentation

Ticket-ID: #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`

elpic commented May 31, 2023

Copy link
Copy Markdown
Author

Sorry for the delay. The code is formatted now

dusan-trickovic linked an issue Jul 13, 2023 that may be closed by this pull request
1 task

Copy link
Copy Markdown

@elpic this is a great improvement for this action 👏

Copy link
Copy Markdown

Can we get this merged?

Copy link
Copy Markdown

This would be a great addition.

1stvamp commented Nov 13, 2024

Copy link
Copy Markdown

Another +1 for merging this 🙏

Copy link
Copy Markdown

I'd love to have this merged 🙏

Copy link
Copy Markdown
Contributor

Hello @elpic,
There are conflicts that need to be resolved before merging. Please resolve these conflicts and address any other issues. Once resolved, we will review it before merging.

Copy link
Copy Markdown
Contributor

Hi @elpic,
Just a friendly reminder to resolve the conflicts when you get a chance. Once everything is addressed, we’ll be happy to review and merge. Let us know if you need any help!

Copy link
Copy Markdown
Contributor

Hi @elpic,

We are closing this Pull Request as this feature is implemented in PR #1043.
Please feel free to reach out if you need any further assistance.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

Unable to use asdf-vm based version-file

Back | FazBrowse Home | New Git URL