@@ -106,27 +106,27 @@ def _disable_pip_configuration_settings():
106106 os .environ ['PIP_CONFIG_FILE' ] = os .devnull
107107
108108
109- def bootstrap (* , root = None , upgrade = False , user = False ,
109+ def bootstrap (* , root = None , prefix = None , upgrade = False , user = False ,
110110 altinstall = False , default_pip = False ,
111111 verbosity = 0 ):
112112 """
113113 Bootstrap pip into the current Python installation (or the given root
114- directory).
114+ and directory prefix ).
115115
116116 Note that calling this function will alter both sys.path and os.environ.
117117 """
118118 # Discard the return value
119- _bootstrap (root = root , upgrade = upgrade , user = user ,
119+ _bootstrap (root = root , prefix = prefix , upgrade = upgrade , user = user ,
120120 altinstall = altinstall , default_pip = default_pip ,
121121 verbosity = verbosity )
122122
123123
124- def _bootstrap (* , root = None , upgrade = False , user = False ,
124+ def _bootstrap (* , root = None , prefix = None , upgrade = False , user = False ,
125125 altinstall = False , default_pip = False ,
126126 verbosity = 0 ):
127127 """
128128 Bootstrap pip into the current Python installation (or the given root
129- directory). Returns pip command status code.
129+ and directory prefix ). Returns pip command status code.
130130
131131 Note that calling this function will alter both sys.path and os.environ.
132132 """
@@ -162,6 +162,8 @@ def _bootstrap(*, root=None, upgrade=False, user=False,
162162 args = ["install" , "--no-cache-dir" , "--no-index" , "--find-links" , tmpdir ]
163163 if root :
164164 args += ["--root" , root ]
165+ if prefix :
166+ args += ["--prefix" , prefix ]
165167 if upgrade :
166168 args += ["--upgrade" ]
167169 if user :
@@ -237,6 +239,11 @@ def _main(argv=None):
237239 default = None ,
238240 help = "Install everything relative to this alternate root directory." ,
239241 )
242+ parser .add_argument (
243+ "--prefix" ,
244+ default = None ,
245+ help = "Install everything using this prefix." ,
246+ )
240247 parser .add_argument (
241248 "--altinstall" ,
242249 action = "store_true" ,
@@ -256,6 +263,7 @@ def _main(argv=None):
256263
257264 return _bootstrap (
258265 root = args .root ,
266+ prefix = args .prefix ,
259267 upgrade = args .upgrade ,
260268 user = args .user ,
261269 verbosity = args .verbosity ,
0 commit comments