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

Do not merge command-line options and nox.options in place #357

Merged
merged 1 commit into from Nov 13, 2020

Conversation

cjolowicz
Copy link
Collaborator

Fixes #356

When merging options specified in the noxfile and on the command-line, do not use the output parameter command_args as the input for the merge. Instead, copy command_args initially and pass the copy to the merge functions.

Merge functions such as _session_filters_merge_func inspect command_args to see if other options have been specified on the command-line. When the options are merged in place, this check produces false positives.

For example, nox.options.sessions is copied into command_args as a part of the merge. So it will appear to have been specified on the command-line when merging nox.options.pythons, causing the latter to be ignored.

When merging options specified in the noxfile and on the command-line option, do
not use the output parameter `command_args` as the input for the merge; instead,
copy `command_args` initially and pass the copy to the merge functions.

Merge functions such as `_session_filters_merge_func` inspect `command_args` to
see if other options have been specified on the command-line. When the options
are merged in place, this check produces false positives.

For example, `nox.options.sessions` is copied into `command_args` as a part of
the merge; so it will appear to have been specified on the command-line when
merging `nox.options.pythons`, causing the latter to be ignored.
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.

nox.options.pythons ignored when nox.options.sessions is present
2 participants