-
-
Notifications
You must be signed in to change notification settings - Fork 151
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
Add a default=True
argument to nox.session
#654
Comments
Sounds good to me! Using a parameter (instead of a variable) could be more human-readable, maybe? Any thoughts from the maintainers? |
Fair enough, if there isn't a desire to add this obviously feel free to close -- I've basically started copy pasting this into all my noxfiles which I'm happy to keep doing if others don't need this. |
I would be very interested by this functionality. Just to give you a use case, we manage the translation of our Sphinx theme with Babel. update and compilation is managed by a nox session and a 2nd one is used to add extra languages. we would like to exclude the "init_language" from the default. |
I would love this for autopep8. I have a flake8 session that I want to run by default. If I could, I would make an autopep8 session that was skipped by default, and then (Or Another use would be a session to run |
I'd also really like something like this. I'm currently experimenting with the following: import nox
skip = {"foobar"}
# Needs to go at the bottom of `noxfile.py`:
nox.options.sessions = [key for key in nox.registry.get() if key not in skip] Which isn't perfect, but might do the trick in some cases. I was also thinking about writing my own custom decorators, like an |
How would this feature be useful?
I'd like to write
as a DRYer alternative to:
i.e. to be able to specify whether a session is run by default or not when defining it, rather than hardcoding the sessions that should be run.
Has this been considered before perhaps?
Describe the solution you'd like
Programmatically build up
nox.options.sessions
unless it's defined explicitly via the addition of a parameter (defaulting to True to match the current behavior) which defines whether a session is run by default or not.Describe alternatives you've considered
Obviously there could be some noodling on what to call the parameter.
Anything else?
No response
The text was updated successfully, but these errors were encountered: