Multiple Python versions as a comma-separated list
Thanks for maintaining the project and considering my idea 🙂
Description: Allowing the action to accept comma-separated lists of Python versions would enhance the user experience if the versions are passed dynamically, as an output from another job.
Justification:
Assume I would like to define multiple Python versions dynamically, e.g., by using a script get_python_versions.py that parses the pyproject.toml file (let us say, from classifiers or requires-python). The script prints the \n-separated list of strings to terminal:
$ python get_python_versions.py
3.9
3.10
3.11
3.12
Then I would like to use the script's output in the action. Since the action accepts newline-separated lists only, I have to do the following:
jobs:
python-versions:
runs-on: ubuntu-latest
outputs:
python-versions: ${{ steps.python-versions.outputs.python-versions }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- id: python-versions
run: |
echo "python-versions<<EOF" >> $GITHUB_OUTPUT
echo "$(python get_python_versions.py)" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
build:
needs:
- python-versions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ needs.python-versions.outputs.python-versions }}
This works nicely. But... Now assume that the script returns a comma-separated list:
$ python get_python_versions.py
3.9,3.10,3.11,3.12
If comma-separated lists were allowed as the action's input, the python-versions step would be more concise and less verbose:
...
- id: python-versions
run: |
echo "python-versions=$(python get_python_versions.py)" >> $GITHUB_OUTPUT
...
Are you willing to submit a PR?
I'm not familiar with Node/JS, so I'm not sure whether I am capable of opening a PR.
Hello @paduszyk, Thank you for creating this feature request and we will get back to you once we have some feedback on this :)
Hello @paduszyk, Thanks for the suggestion. After reviewing it, we believe the change could potentially disrupt existing workflows that rely on the current newline-separated format, which makes it less feasible at this time. We prioritize backward compatibility, so we’re unable to move forward with this request.
That said, we always welcome feedback and suggestions on how to improve the setup functionalities, so please feel free to share any other ideas you may have.
We appreciate your understanding and will keep this in mind for future considerations.
Hello @paduszyk, please let us know if you have any further concerns or need clarification on the above comment. Thank you.
Hello @paduszyk, please let us know if you have any further concerns or need clarification on the above comment. Thank you.
@aparnajyothi-y I'm OK. Thanks for considering.
Hello @paduszyk, Thank you for confirming! We appreciate your understanding and input, and we're open to considering any future suggestions. Please don’t hesitate to reach out if you have any further thoughts or ideas. With that, we’ll proceed to close the issue.