Don't import `virtualenv` if it is not actually needed.
Importing virtualenv causes setuptools plugins being executed. So it causes them being initialized and executed multiple times, which is slow. I know that that flaw is not in the build, but importing the unneeded (I always use -n flag) virtualenv and so wasting time and memory on its loading is a flaw by itself.
It is proposed to move importing of virtualenv into the functions actually using it.
This was done in #361 which has languished. Feel free to factor the virtualenv change out in a separate PR.
Supposedly gh-361 was superseded by gh-537, which was merged. So, this can be closed?
try:
import virtualenv
except ModuleNotFoundError:
virtualenv = None
is still present.
Seems like this should be a find spec instead.