Description
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.