You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
nox supports --no-install and -R options for not running installation commands, usually for use when reusing existing environments, and to speed up development where the install process is often the long pole.
But there doesn't seem to be a good way to indicate when something run via session.runis an install command -- specifically, if you're installing something not via pip or conda etc, which you may want to skip in the same scenarios as the above.
Concretely -- given a Javascript project, one might run (p)npm install to install all the project dependencies, followed by some test runner, e.g. jest, all under a noxenv called ui-tests.
In this scenario it would be nice if nox -s ui-tests -R was able to not run the install command, but the existing -R of course has no way to know which command to skip.
Even doing this externally (in the noxfile) seems nontrivial, as it seems the way session.install does this is by accessing private internals, e.g.:
Add a session.run_install(...) command which runs a subprocess but assumes that subprocess is an installation command which will be skipped when using -R / --no-install.
Refactoring session.install and session.conda_install to call this to do their no_install check seems also like a nice minor internal refactor.
Describe alternatives you've considered
I personally don't like boolean flags (as a rule), but session.run(..., is_install=True) is an alternative for those who are less averse.
A further alternative is to make more things public API (e.g. whether no_install is active) so that someone can do this themselves in their noxfile, but given that nox itself has 2 places where it itself wants this, it seems like something generally useful to me.
Anything else?
A concrete noxfile where I wanted this functionality is here.
The text was updated successfully, but these errors were encountered:
This already exists, but for historic reasons it's called session.run_always. It keeps tripping up people. IMO we should alias this to session.run_install, keeping the old name for compatibility.
Huh, I swear I saw run_always and for some reason thought it still wasn't the right thing, but looking at it again it does indeed look like you're right!
I understand the history I think, there was only a --install-only original right, and so this was "run in that case too" hence the "always" -- but yeah the name seems really unfortunate now.
How would this feature be useful?
nox
supports--no-install
and-R
options for not running installation commands, usually for use when reusing existing environments, and to speed up development where the install process is often the long pole.But there doesn't seem to be a good way to indicate when something run via
session.run
is an install command -- specifically, if you're installing something not viapip
orconda
etc, which you may want to skip in the same scenarios as the above.Concretely -- given a Javascript project, one might run
(p)npm install
to install all the project dependencies, followed by some test runner, e.g.jest
, all under a noxenv calledui-tests
.In this scenario it would be nice if
nox -s ui-tests -R
was able to not run the install command, but the existing-R
of course has no way to know which command to skip.Even doing this externally (in the noxfile) seems nontrivial, as it seems the way
session.install
does this is by accessing private internals, e.g.:nox/nox/sessions.py
Lines 629 to 630 in 5c82dc5
Describe the solution you'd like
Add a
session.run_install(...)
command which runs a subprocess but assumes that subprocess is an installation command which will be skipped when using-R
/--no-install
.Refactoring
session.install
andsession.conda_install
to call this to do theirno_install
check seems also like a nice minor internal refactor.Describe alternatives you've considered
I personally don't like boolean flags (as a rule), but
session.run(..., is_install=True)
is an alternative for those who are less averse.A further alternative is to make more things public API (e.g. whether no_install is active) so that someone can do this themselves in their noxfile, but given that
nox
itself has 2 places where it itself wants this, it seems like something generally useful to me.Anything else?
A concrete
noxfile
where I wanted this functionality is here.The text was updated successfully, but these errors were encountered: