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 11 commits into from Jul 1, 2018


None yet
2 participants

techalchemy commented Jul 1, 2018

  • Lazily import requirementslib
  • Fixes #2843

Signed-off-by: Dan Ryan


This comment has been minimized.


techalchemy commented Jul 1, 2018

Before PR:

 ~/g/pypa-pipenv       time -p pipenv --venv
real 0.93
user 0.84
sys 0.08

After PR:

 ~/g/pypa-pipenv   import-time-improvement     
real 0.31
user 0.26
sys 0.04

techalchemy added some commits Jul 1, 2018

Improve import times and runtimes
- Lazily import requirementslib

Signed-off-by: Dan Ryan <>
More improvements
Signed-off-by: Dan Ryan <>
Reimplement `get_workon_home` to save import
- Pew import is super expensive
- Fixes #2843

Signed-off-by: Dan Ryan <>
Add missed import
Signed-off-by: Dan Ryan <>
Add additional comparison for markers
Signed-off-by: Dan Ryan <>

@techalchemy techalchemy force-pushed the import-time-improvement branch from f45e72a to 547110b Jul 1, 2018

@techalchemy techalchemy added this to the 2018.7.0 milestone Jul 1, 2018

@@ -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

This comment has been minimized.


uranusjr Jul 1, 2018


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

techalchemy and others added some commits Jul 1, 2018

Use more local tests
Signed-off-by: Dan Ryan <>

@techalchemy techalchemy merged commit ebaadfc into master Jul 1, 2018

3 checks passed

VSTS: pipenv-Python Package-CI 20180701.5 succeeded
buildkite/pipenv Build #687 passed (9 minutes, 54 seconds)
continuous-integration/appveyor/pr AppVeyor build succeeded

@techalchemy techalchemy deleted the import-time-improvement branch Jul 1, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment