wntrblm / nox

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

Remove legacy support for running a function in run? #813

Closed henryiii closed 4 months ago

henryiii commented 5 months ago

There's a legacy feature where session.run([f, arg1], kw=1) will run f(arg1, kw=1) for you, with a little bit of logging. I'm working on improving the static typing a bit, and this is messy. It's not in the static typing, it interferes with normal keyword arguments, and it has a bug: env= and include_outer_env= just get thrown away and aren't passed through. To support it properly, everything would need to be **kwargs, which I'm trying to get rid of (better static typing, better docstrings, better signatures). I could fix the static typing via TypedDict, but I'd much rather just remove the feature (described as "legacy" in comments) if it's acceptable.

By remove, I really mean remove the keyword argument passing, I don't care about the positional argument only form unless I have to add it to typing. We could leave that in, at least for a while, if someone wants it. It's the keywords that are problematic and currently buggy.