nox icon indicating copy to clipboard operation
nox copied to clipboard

Add concept of "optional" parameter

Open dhermes opened this issue 6 years ago • 5 comments

For example, if I wanted to (as a nox user) impl. my own support for arch (as in #60), then I'd want to do something like:

$ nox -s "unit(py='2.7', arch='32')"

but I wouldn't want

$ nox -s "unit(py='2.7')"

to run over all choices of arch, I would just want arch to be ignored (arch would only be relevant on OS X).

Since nox has a lot of pytest-like interfaces, I threw together an example of how pytest deals with optional test cases with pytest.mark.parametrize. (Isn't a perfect mapping.)


NOTE: @jonparrott and I discussed this earlier this week, I just never filed an issue

dhermes avatar Sep 30 '17 19:09 dhermes

@theacodes Optional parameters are useful independent of specifying architecture as in #60 (and discussed in #63).

ISTM that implementing a way to specify or pass-through the architecture would be much easier if we had optional parameters in nox.

So tackling this would both add a nice feature and enable a simpler impl. of the architecture feature as well. WYDT?

dhermes avatar Oct 12 '17 22:10 dhermes

@dhermes do you still think this is relevant?

theacodes avatar Aug 24 '18 03:08 theacodes

Yes I do still think it's relevant, since there are certain parameter combinations that only make since in restricted environments (e.g. in a container, on Windows, etc.)

dhermes avatar Aug 24 '18 03:08 dhermes

The blocker on this issue is figuring out exactly how this would work and how we would invoke it using -s and -k.

theacodes avatar May 15 '19 07:05 theacodes