setup-python icon indicating copy to clipboard operation
setup-python copied to clipboard

Fetching Python version from Pipenv's `Pipfile`

Open kalrish opened this issue 3 years ago • 5 comments

Description: The Python version to set up may be specified with the input python-version-file. As I submit this feature request, this input expects a file containing only the Python version, as used by pyenv. I propose that the feature be extended to support the TOML key requires.python_version in Pipenv's Pipfile.

#542 has been submitted as a similar request for pyproject.toml, another file in TOML format.

Justification: Dependencies of Python apps not meant to be distributed are often managed with Pipenv, which is developed and maintained by the Python Packaging Authority (PyPA) and their documented tool. Pipenv allows to specify the oldest Python version the app requires in the Pipfile.

The action setup-node, too, can load the Node.js version to set up from a variety of files. It, however, supports not just files containing only the Node.js version, like .nvmrc and .node_version, but also the structured format of package.json.

Are you willing to submit a PR? Yes, I am. If you want me to contribute the described functionality, please let me know of any preferences regarding TOML libraries.

kalrish avatar Dec 24 '22 17:12 kalrish

Hello @kalrish! Thank you for reporting this! We'll consider updating the parsing logic for the python-version-file input.

MaksimZhukov avatar Dec 26 '22 10:12 MaksimZhukov

Thank you, @MaksimZhukov. If you decide to accept this feature, I would be glad to implement it for you, or at least try. In any case, I wish you a good start into the new year :). Take care!

kalrish avatar Dec 30 '22 14:12 kalrish

This would be a most welcome addition.

dav-tb avatar Oct 23 '23 22:10 dav-tb

Similar to this, pyproject.toml support would be also nice. The project.requires-python key contains Python version requirement.

[project]
requires-python = ">=3.11"

WieeRd avatar Jan 15 '24 03:01 WieeRd