Skip to content
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: GitHub Action #594

Merged
merged 5 commits into from
Apr 28, 2022
Merged

Conversation

henryiii
Copy link
Collaborator

@henryiii henryiii commented Apr 7, 2022

The officially recommended action, excitedleigh/setup-nox, has been untouched for a year or so now, with PRs building up, and now is broken due to a PyPy update on the runners - daisylb/setup-nox#419. All usages on all GitHub hosted runners are broken.

In the last year, GitHub has made it dramatically easier for a library to provide it's own action with composite actions, then recently composite actions actually became able to compose other actions (which, why was that not a launch feature for something called "composite" actions, but better late than never...). So it's now possible to provide a very simple action (than can be pinned to an exact nox version, and auto-updated via dependabot!) with minimal maintenance burden. We've been providing one with cibuildwheel for quite a while now, and it's been very popular has has worked well, especially with dependabot.

Unlike the javascript setup-nox action above, it's really easy to place any Python versions in this action, and have full control over when they are added/removed. This means there's also some choice here - should it activate all non-EOL Pythons, or all Pythons supported by Nox? There's a small1 time cost in activating a Python version that's pre-built but not pre-installed (must be downloaded), so I think all non-EOL Pythons is best - this action gracefully blends with adding setup-python's for the other Pythons. This also is a pretty close match for the current setup-nox action.

I'm got an example/test run here: scikit-build/scikit-build#692.

Footnotes

  1. About 6 seconds on linux/windows, and 18 seconds on macOS, AFAICT. On linux/windows, these sometimes are already there - 2.7 is, 3.6 sometimes is.

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
@FollowTheProcess
Copy link
Collaborator

Love this! Big +1 from me. Also a TIL I didn't know you could make actions this easily!


.. _pip: https://pip.readthedocs.org
.. _user site: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site
.. _pipx: https://packaging.python.org/guides/installing-stand-alone-command-line-tools/
.. _docker: https://www.docker.com/
.. _thekevjames/nox images: https://hub.docker.com/r/thekevjames/nox
.. _GitHub Actions: https://github.com/features/actions
.. _excitedleigh/setup-nox action: https://github.com/marketplace/actions/setup-nox
.. _wntrblm/nox action: https://github.com/marketplace/actions/nox
Copy link
Collaborator Author

@henryiii henryiii Apr 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, this link assumes you click "publish this action" after this in GitHub Actions. In cibuildwheel, we've not done that (to avoid a "this is an action in the marketplace" banner at the top to make it look like it's only for GitHub Actions). If you'd prefer not to "publish to the marketplace" (which doesn't really do anything other than make it a tiny bit more searchable), then this link should point somewhere else, or not be a link at all.

I did check to make sure the name "nox" has not been taken yet.

Copy link
Collaborator

@FollowTheProcess FollowTheProcess Apr 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't see any harm in publishing it in this way, it'd be nice to have an official nox action in the marketplace :) If any other maintainers feel differently though please chime in!

Edit: I'm dumb, see below

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It just clicked what you meant by this @henryiii! For anyone else as slow to catch on as me, this is what we mean:

image

If we publish the action in the marketplace, the Nox repo will have that banner above it which implies it's just a GitHub action so IMO it's best to avoid as @henryiii did with cibuildwheel

@FollowTheProcess
Copy link
Collaborator

Personally I'm keen to get this in, especially if the currently recommended action is falling out of maintenance. It'd be nice to have an official action I think!

I've never written a GitHub action but I'm assuming the:

name: Setup Nox

Would translate into an action syntax of:

steps:
  - name: Set up Nox
    uses: wntrblm/setup-nox

?

Is it possible (or even necessary) to test the action? I know it's a composite and is basically stitching together some others that are already battle tested, it would just be nice to have a nice CI green light that we haven't broken it.

@henryiii
Copy link
Collaborator Author

henryiii commented Apr 21, 2022

I've got an example using the fork this PR is from linked above, here it is again:

scikit-build/scikit-build#692

This would be a minimal steps:

steps:
- uses: actions/checkout@v3

- name: Setup nox
  uses: wntrblm/nox

- run: nox

I would expect realistic uses to split the run: nox up into multiple runs with one session each, so that it groups nicely in the UI.

@excitedleigh fixed the action 9 days ago! But didn't release a new version, so dependabot won't update it (needs a tag). I think it would be fine to list/have both (if it gets a working release) - that action might be slightly faster, but this action is version locked to nox (since it is nox). A in-repository action like the one in this PR can actually pin via nox version automatically and be updated via dependabot, something other actions can't do.

@FollowTheProcess
Copy link
Collaborator

FollowTheProcess commented Apr 27, 2022

@wntrblm/nox Any thoughts or objections? If no one objects I'll merge this in, but probably not publish to the GitHub marketplace as discussed up here: #594 (comment)

@DiddiLeija
Copy link
Collaborator

No objections from my side 👍

@theacodes
Copy link
Collaborator

Sounds great!

@FollowTheProcess FollowTheProcess merged commit ca5f6e7 into wntrblm:main Apr 28, 2022
mayeut added a commit to mayeut/nox that referenced this pull request May 7, 2022
Per wntrblm#594 (comment), `wntrblm/nox` will not be published on the marketplace.
mayeut added a commit to mayeut/nox that referenced this pull request May 7, 2022
Per wntrblm#594 (comment), `wntrblm/nox` will not be published on the marketplace.
FollowTheProcess pushed a commit that referenced this pull request May 10, 2022
Per #594 (comment), `wntrblm/nox` will not be published on the marketplace.
@daisylb
Copy link
Contributor

daisylb commented Aug 8, 2022

Well, now I can cross a lot of things off of my to-do list <3

@henryiii henryiii deleted the henryiii/feat/action branch August 8, 2022 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants