setup-python
setup-python copied to clipboard
Enhance reading from .python-version
Enhance reading from .python-version file, matching the Pyenv behavior:
- resolves multiple versions from multiple lines
- handles pyenv-virtualenv pointers (e.g.
3.10/envs/virtualenv) (see pyenv/pyenv-virtualenv#472) - ignores empty lines and lines starting with
# - trims whitespace
Closes #734 and supersedes #647.
Check list:
- [x] Mark if documentation changes are required.
- [x] Mark if tests were added or updated to cover the changes.
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4 with: python-version: 'graalpy-22.3'
- run: python my_script.py