Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Improve import times and runtimes #2485

Merged
merged 11 commits into from Jul 1, 2018
Merged

Conversation

techalchemy
Copy link
Member

@techalchemy techalchemy commented Jul 1, 2018

Signed-off-by: Dan Ryan dan@danryan.co

@techalchemy
Copy link
Member Author

Before PR:

 ~/g/pypa-pipenv       time -p pipenv --venv
/home/hawk/.virtualenvs/pypa-pipenv-PuUpLSqX
real 0.93
user 0.84
sys 0.08

After PR:

 ~/g/pypa-pipenv   import-time-improvement     
/home/hawk/.virtualenvs/pypa-pipenv-PuUpLSqX
real 0.31
user 0.26
sys 0.04

- Lazily import requirementslib

Signed-off-by: Dan Ryan <dan@danryan.co>
Signed-off-by: Dan Ryan <dan@danryan.co>
- Pew import is super expensive
- Fixes #2843

Signed-off-by: Dan Ryan <dan@danryan.co>
Signed-off-by: Dan Ryan <dan@danryan.co>
Signed-off-by: Dan Ryan <dan@danryan.co>
@techalchemy techalchemy added this to the 2018.7.0 milestone Jul 1, 2018
pipenv/core.py Outdated
@@ -139,6 +132,8 @@ def which(command, location=None, allow_global=False):

# Disable warnings for Python 2.6.
if 'urllib3' in globals():
import urllib3
from urllib3.exceptions import InsecureRequestWarning
urllib3.disable_warnings(InsecureRequestWarning)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be eliminated altogether. We don’t support 2.6 anymore.

@techalchemy techalchemy merged commit ebaadfc into master Jul 1, 2018
@techalchemy techalchemy deleted the import-time-improvement branch July 1, 2018 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants