wntrblm / nox

Flexible test automation for Python
https://nox.thea.codes
Apache License 2.0
1.32k stars 151 forks source link

Support an environment variable override for `nox.options.default_venv_backend` #776

Closed edgarrmondragon closed 8 months ago

edgarrmondragon commented 8 months ago

How would this feature be useful?

Often times it's easier to set an environment variable than passing the same argument to multiple commands.

Describe the solution you'd like

A new environment variable that's used as the default value of --default-venv-backend when present.

Some possible names: NOX_DEFAULT_VENV_BACKEND or NOXDEFAULTVENVBACKEND

Describe alternatives you've considered

Something like

# noxfile.py

import os

import nox

nox.options.default_venv_backend = os.environ.get("NOX_DEFAULT_VENV_BACKEND", "virtualenv")

Anything else?

If this accepted, I can start working on a PR :)

henryiii commented 8 months ago

NOX_DEFAULT_VENV_BACKEND sounds good to me.