Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Closed
KOLANICH opened this issue Sep 2, 2022 · 4 comments · Fixed by #636
Closed

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

KOLANICH opened this issue Sep 2, 2022 · 4 comments · Fixed by #636

Comments

@KOLANICH
Copy link
Contributor

KOLANICH commented Sep 2, 2022

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.

@layday
Copy link
Member

layday commented Sep 2, 2022

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

@astrojuanlu
Copy link

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

@KOLANICH
Copy link
Contributor Author

KOLANICH commented Jul 3, 2023

try:
    import virtualenv
except ModuleNotFoundError:
    virtualenv = None

is still present.

@henryiii
Copy link
Contributor

henryiii commented Jul 3, 2023

Seems like this should be a find spec instead.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants