Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3987)

Unified Diff: bootstrap/bootstrap.py

Issue 2816633002: bootstrap: Invoke "pip" through Python. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bootstrap/bootstrap.py
diff --git a/bootstrap/bootstrap.py b/bootstrap/bootstrap.py
index e752cc2a84241575db06762e7d9dd2d72fa1f639..7d8cf8c7d17b226f6531b3be7bb2cc201dda5fcd 100755
--- a/bootstrap/bootstrap.py
+++ b/bootstrap/bootstrap.py
@@ -24,6 +24,10 @@ ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
PYTHON_BAT_WIN = '@%~dp0\\..\\Scripts\\python.exe %*'
+IS_WINDOWS = sys.platform.startswith('win')
+
+EXE_SUFFIX = '.exe' if IS_WINDOWS else ''
+
class NoWheelException(Exception):
def __init__(self, name, version, build, source_sha):
@@ -75,7 +79,8 @@ def sha_for(deps_entry):
def install(deps, cache_root):
- bin_dir = 'Scripts' if sys.platform.startswith('win') else 'bin'
+ bin_dir = 'Scripts' if IS_WINDOWS else 'bin'
+ python = os.path.join(sys.prefix, bin_dir, 'python%s' % (EXE_SUFFIX,))
pip = os.path.join(sys.prefix, bin_dir, 'pip')
requirements = []
@@ -98,7 +103,7 @@ def install(deps, cache_root):
# Download the package into our cache directory.
subprocess.check_call([
- pip, 'download',
+ python, pip, 'download',
'--find-links', 'file://' + wheel_cache_dir,
'--dest', wheel_cache_dir,
] + requirements,
@@ -106,7 +111,7 @@ def install(deps, cache_root):
# Install the downloaded packages.
subprocess.check_call([
- pip, 'install',
+ python, pip, 'install',
'--find-links', 'file://' + wheel_cache_dir,
'--no-index',
] + requirements,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698