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

Decouple merging of --python with nox.options from --sessions and --keywords #359

Merged
merged 6 commits into from Nov 14, 2020

Conversation

cjolowicz
Copy link
Collaborator

Closes #358

This PR is a follow-up to #357, and contains the following additional changes:

1. Do not ignore nox.options.pythons when --{sessions,keywords} passed

Declare the --python option without a custom merge function, i.e. omit the merge_func parameter. As a result, nox.options.pythons will no longer be ignored when --sessions or --keywords are passed.

2. Do not ignore nox.options.{sessions,keywords} when --pythons passed

Revert _session_filters_merge_func to the state before --pythons was introduced. This means that it will only check if --sessions or --keywords were specified on the command-line. As a result, the nox.options.sessions and nox.options.keywords settings will no longer be ignored when --pythons is passed.

@theacodes
Copy link
Collaborator

How do you feel about adding a test case to cover this?

(Also I merged the base PR, can you rebase?)

The noxfile.py is templated with the default session (`nox.options.sessions`),
and the default Python version (`nox.options.pythons`), as well as an alternate
Python version.

This allows us to avoid the situation where a test case running on one Python
version needs to launch Nox using another Python version. As a side-effect, it
makes the test cases a bit more explicit.
Revert function name to the one used before --pythons was introduced.
@cjolowicz
Copy link
Collaborator Author

@theacodes Added tests and rebased.

The tests use a fixture to generate noxfile.py from a template with a default session (nox.options.sessions) and the default Python version (nox.options.pythons), as well as an alternate Python version. This allows us to avoid the situation where a test case running on one Python version needs to launch Nox using another Python version. As a side-effect, it also makes the test cases a bit more explicit.

@theacodes theacodes merged commit 6bdf51c into wntrblm:master Nov 14, 2020
@theacodes
Copy link
Collaborator

Thank you!

@cjolowicz
Copy link
Collaborator Author

Thank you for reviewing and merging this @theacodes 🙂

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.sessions ignored when --pythons is passed
2 participants