Proposed change
I'd like there to be a way for session names to be created with dashes instead of special characters. For example, tests-3.14(resolution='highest') would instead be tests-3.14-resolution-highest. This would be akin to the naming scheme used by tox.
Hyphenated names could be enabled via a configuration option:
nox.option.hyphenated_session_names = True
An additional possibility would be to create a command line option, like --hyphenated-session-names or -h.
Background
Currently, the names of parametrized sessions include special characters like (i.e., (, ), =, '). Some example session names are tests(resolution='highest'), tests-3.12(resolution='lowest-direct'), and tests-3.14(highest).
If we naively pass the name of one of these sessions to nox -s, we'd get an error:
$ nox -s tests-3.14(resolution='highest')
bash: syntax error near unexpected token `('
It's necessary to either put the session name in quotes or escape the special characters.
nox -s "tests-3.14(resolution='highest')"
nox -s tests-3.14\(resolution\=\'highest\'\)
How would this feature be useful?
In addition to making command-line usage a little more user-friendly, the main use case I have in mind is autocompletions. I've been experimenting with autocompletions for the fish shell, and I've been running into difficulty doing this with nox sessions because of the use of special characters. In particular, the special characters are automatically getting escaped, which makes the command a lot less readable.
Thank you to everyone involved with creating this awesome tool!
Proposed change
I'd like there to be a way for session names to be created with dashes instead of special characters. For example,
tests-3.14(resolution='highest')would instead betests-3.14-resolution-highest. This would be akin to the naming scheme used by tox.Hyphenated names could be enabled via a configuration option:
An additional possibility would be to create a command line option, like
--hyphenated-session-namesor-h.Background
Currently, the names of parametrized sessions include special characters like (i.e.,
(,),=,'). Some example session names aretests(resolution='highest'),tests-3.12(resolution='lowest-direct'), andtests-3.14(highest).If we naively pass the name of one of these sessions to
nox -s, we'd get an error:It's necessary to either put the session name in quotes or escape the special characters.
How would this feature be useful?
In addition to making command-line usage a little more user-friendly, the main use case I have in mind is autocompletions. I've been experimenting with autocompletions for the fish shell, and I've been running into difficulty doing this with nox sessions because of the use of special characters. In particular, the special characters are automatically getting escaped, which makes the command a lot less readable.
Thank you to everyone involved with creating this awesome tool!