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

Add a nox.options.verbose configuration option #741

Open
agriyakhetarpal opened this issue Sep 22, 2023 · 0 comments
Open

Add a nox.options.verbose configuration option #741

agriyakhetarpal opened this issue Sep 22, 2023 · 0 comments

Comments

@agriyakhetarpal
Copy link

agriyakhetarpal commented Sep 22, 2023

How would this feature be useful?

Currently nox does not notify the user of what packages were installed by pip on the use of session.install() syntax. It is possible to do so by using the --verbose command-line flag. There is #666 that is (somewhat) related. Adding a way to make nox session arguments verbose by default would help evade the use of --verbose and therefore display verbose output by default.

For example

@nox.session(name="tests")
def run_tests(session):
    """Run the unit tests."""
    session.install("-e", ".[test]")
    session.run("pytest")

can be called with

nox -s tests --verbose

to display pip's installation output when invoking a nox session. However, this use-case is not limited to just this, and displaying verbose outputs at the time of virtual environment creation can also help for debugging purposes.

Describe the solution you'd like

It would be great to have an option in this form

# perhaps kept False by default
nox.options.verbose = True

which can then apply to all sessions invoked inside a noxfile. If verbosity is not required for a particular session, it can be overridden for said session by @nox.session(verbose=False) which takes precedence over nox.options.

Another solution is to just make pip display complete output in all cases (tox environments have always done this, with or without a verbose command-line flag or option).

Describe alternatives you've considered

The current workaround for this is to use

 session.run_always("pip", "install", "-e", ".[test]")

as an alias to session.install(), which for users means that

  1. conda or pip inside this command has to be specified explicitly which
  2. This will make it run even in the presence of --no-install, which does not help in the case where speedups are required (not that pip output is required anyway when not installing prerequisites or other dependencies).

There is also session.install(silent=False) which is a nice way and already resolves this issue; however, it would be great it there could be a way to let it be so for all session.install() commands on a per-noxfile or per-session basis.

Anything else?

N/A

@agriyakhetarpal agriyakhetarpal changed the title Add Add a nox.options.verbose configuration option Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant