You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, I don't think that's entirely obvious. The name of the argument is --keywords and the docs also refer to "pytest-style keywords".
The issue arises if the user attempts to do a keyword match on a custom session name, which may contain characters that are not valid in Python identifiers. Using one of those characters in the --keywords expression raises a SyntaxError when it is evaluated.
Nox could provide some guidance here on how to resolve the issue. With the current behavior (printing a SyntaxError and stack trace), it's not clear to the user whether the issue is an invalid argument or a bug in Nox.
Describe the solution you'd like
It would be nice if the keywords argument could support matching on session names, including characters that aren't allowed in Python identifiers.
Describe alternatives you've considered
Validating the keywords expression and printing a descriptive error message (#493) would help users resolve the error.
The text was updated successfully, but these errors were encountered:
How would this feature be useful?
Currently, providing a
--keywords
argument that is not a valid expression causes Nox to crash with a SyntaxError.The value of the
--keywords
argument should be a Python expression. That expression is evaluated to filter the list of sessions./~https://github.com/theacodes/nox/blob/a2bd140ed9702428d3fc93be9857879388f21ad0/nox/manifest.py#L347-L350
However, I don't think that's entirely obvious. The name of the argument is
--keywords
and the docs also refer to "pytest-style keywords".The issue arises if the user attempts to do a keyword match on a custom session name, which may contain characters that are not valid in Python identifiers. Using one of those characters in the
--keywords
expression raises a SyntaxError when it is evaluated.Nox could provide some guidance here on how to resolve the issue. With the current behavior (printing a SyntaxError and stack trace), it's not clear to the user whether the issue is an invalid argument or a bug in Nox.
Describe the solution you'd like
It would be nice if the keywords argument could support matching on session names, including characters that aren't allowed in Python identifiers.
Describe alternatives you've considered
Validating the keywords expression and printing a descriptive error message (#493) would help users resolve the error.
The text was updated successfully, but these errors were encountered: