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: support default=False #810

Merged
merged 1 commit into from
Apr 8, 2024
Merged

Conversation

henryiii
Copy link
Collaborator

@henryiii henryiii commented Apr 6, 2024

Fix #686 and fix #654. I looked over #232 (comment), and that doesn't seem to preclude this as an option. It looks like very early nox adopted nox.options as a general solution, but I don't think that means there can't be a per-session option to remove it from the default list.

Personally, I generally do the inverse - I only have a small set of "default" sessions, and most sessions for me are helpers, etc. But it seems a decent number of projects like this mechanism, and it's also very discoverable. It also reads well inline. An added idea would be a nox.options.default = False mechanism to switch the default for default, so that you'd list the sessions you wanted to run with default = True (which I think would match my usage better), but that could always be added later if people want it, and there probably should be some discussion of the name - default on a session is clear, not so much on nox.options. And I don't see a reason to have it on the command line.

I choose default=False over skip=True. Though either would be fine.

All default=False is not special cased, it behaves like an empty file (in other words, it's like nox.options.sessions = None not nox.options.sessions = [], which prints the list of sessions if nothing is specified). Maybe that would be better, though.

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
@henryiii henryiii merged commit 55c7eaf into wntrblm:main Apr 8, 2024
22 checks passed
@henryiii henryiii deleted the henryiii/feat/default branch April 8, 2024 19:36
@henryiii henryiii mentioned this pull request Apr 15, 2024
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.

Add option to skip session by default Add a default=True argument to nox.session
2 participants