def decorator(func: typing.Callable[[Session], None]): func.__name__ = func.__name__.replace("_", "-") return _session(reuse_venv=reuse_venv, **kwargs)(func) if only_if() else func
def decorator( func: _NoxCallbackSig) -> typing.Union[_NoxCallbackSig, Session]: func.__name__ = func.__name__.replace("_", "-") return _session(reuse_venv=reuse_venv, ** kwargs)(func) if only_if() else func