-
Notifications
You must be signed in to change notification settings - Fork 567
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
Automatic Python version determination from pyproject.toml #542
Comments
Hello @BrandonLWhite! Thank you for the suggested idea! |
Just copy from my original request at #629 as supplement to this ticket 😃 Since Poetry has Python version defined in [tool.poetry.dependencies]
python = "3.11.x" It would be great to support reading Python version from Poetry Something like - name: Set up Python
uses: actions/setup-python@v4
with:
python-version-file: path/to/pyproject.toml FYI, today actions/setup-go supports similar way like this: - name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: path/to/go.mod (Inside go.mod, it has Go version defined) Thanks! 😃 |
Any update on this? I would like to use it using the standard Moreover, IMHO the I would love to contribute on this |
Description:
Automatically determine the best Python version to install by parsing pyproject.toml and using the
tool.poetry.dependencies.python
version constraint specifier. The "best" version is the latest available Python version that satisfies the constraint.Justification:
Though the recent support for .python-version file is very helpful, this requires duplication of the Python version declaration in the source project when using Poetry. The version declaration is already in the pyproject.toml, and Poetry already uses it to select the best Python version as described above when working locally. It would be ideal for CI/CD to also use pyproject.toml to determine the best Python version, instead of requiring adding another file to the repo (.python-version) that contains the needed Python version.
Are you willing to submit a PR?
Yes! Before embarking on such and endeavor, I would like to know if the setup-python maintainers are open to such a feature, and what the preferred configuration inputs might look like.
The text was updated successfully, but these errors were encountered: