-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
feat: allow defining a python version list for GHA action #601
Conversation
a9ee341
to
f9617e3
Compare
Hi @mayeut, first of all thanks for spending the time to do this! We appreciate the effort! I have some thoughts though: IMO this is best left to https://github.com/actions/setup-python, the wntrblm/nox action will currently install into whatever python is the default (via pipx, normally a version of 3.8) but combined with a setup-python step to install any desired version, Nox can then launch a session using any version requested. I've tried this myself on some personal projects since we added the action and it works perfectly this way. In addition to the above, I don't like specifying the python version list as a long string in the yaml file, to me this is a smell and a sign that we maybe shouldn't do it that way. Is there any way of specifying this as a true yaml list? If so I think I'd be happier with this but still a bit of me thinks it should be handled by the setup-python action as this is a standard across many languages in GHA, the "accepted" way to get language set up is a "setup-language" action, and this would introduce another way specifically for Nox projects. Having said that, this is all based on my understanding of your proposal which may obviously be wrong, if I am please feel free to challenge! Ditto any other maintainers input on this. |
I also think setup-python can achieve this. Also, in case we decide to not add this feature, we should explain the way to set up a Python version in the Nox's documentation. |
@FollowTheProcess, @DiddiLeija, Thanks for taking the time to review this.
Adding tests to the action shows the following (https://github.com/mayeut/nox/runs/6239157159?check_suite_focus=true):
follow-up PR for this: #606
follow-up PR for documentation: #607 Now that those bits are taken care of, let's go back to the python version list:
I agree with this not being perfect but, unfortunately, GHA inputs only allows string...
Obviously, If I could specify the python list I want to support, then yes, I do want to use the action because it helps in every way possible. The intent will be clear (I do not want to setup 1 python multiple times, I want to setup nox with multiple python versions), the workflows will be more readable and it will never break on the nox action being updated (well, at least not because a python version was dropped in the hard-coded list). I do agree that it's unfortunate that we can't pass a true yaml list, that there's probably still too many hard-coded things in this PR (that, I can probably do something about it) but I really do think the feature is worth the addition, maybe not in this form. |
a75de96
to
8ddd703
Compare
8ddd703
to
62015f1
Compare
closing in favor of #609 |
This PR extends #594 by allowing to define a list of python versions to setup.
The default list is the same as in #594
The list is defined as a string because GitHub Actions does not support lists as inputs.