build icon indicating copy to clipboard operation
build copied to clipboard

Don't import `virtualenv` if it is not actually needed.

Open KOLANICH opened this issue 3 years ago • 1 comments

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.

KOLANICH avatar Sep 02 '22 10:09 KOLANICH

This was done in #361 which has languished. Feel free to factor the virtualenv change out in a separate PR.

layday avatar Sep 02 '22 10:09 layday

Supposedly gh-361 was superseded by gh-537, which was merged. So, this can be closed?

astrojuanlu avatar Jul 03 '23 16:07 astrojuanlu

try:
    import virtualenv
except ModuleNotFoundError:
    virtualenv = None

is still present.

KOLANICH avatar Jul 03 '23 17:07 KOLANICH

Seems like this should be a find spec instead.

henryiii avatar Jul 03 '23 17:07 henryiii