-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
gh-75229: ensurepip does not honour the value of $(prefix) #17634
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
Changes from 1 commit
5754521
184d067
893fc98
4622115
22767b5
a90a458
47927a1
aee28db
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Co-Authored-By: Xavier de Gaye <xdegaye@gmail.com>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,27 +49,27 @@ def _disable_pip_configuration_settings(): | |
os.environ['PIP_CONFIG_FILE'] = os.devnull | ||
|
||
|
||
def bootstrap(*, root=None, upgrade=False, user=False, | ||
def bootstrap(*, root=None, prefix=None, upgrade=False, user=False, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thinking about it, I'm not sure they should be mutual exclusive. If |
||
altinstall=False, default_pip=False, | ||
verbosity=0): | ||
""" | ||
Bootstrap pip into the current Python installation (or the given root | ||
directory). | ||
and directory prefix). | ||
|
||
Note that calling this function will alter both sys.path and os.environ. | ||
""" | ||
# Discard the return value | ||
_bootstrap(root=root, upgrade=upgrade, user=user, | ||
_bootstrap(root=root, prefix=prefix, upgrade=upgrade, user=user, | ||
altinstall=altinstall, default_pip=default_pip, | ||
verbosity=verbosity) | ||
|
||
|
||
def _bootstrap(*, root=None, upgrade=False, user=False, | ||
def _bootstrap(*, root=None, prefix=None, upgrade=False, user=False, | ||
altinstall=False, default_pip=False, | ||
verbosity=0): | ||
""" | ||
Bootstrap pip into the current Python installation (or the given root | ||
directory). Returns pip command status code. | ||
and directory prefix). Returns pip command status code. | ||
|
||
Note that calling this function will alter both sys.path and os.environ. | ||
""" | ||
|
@@ -112,6 +112,8 @@ def _bootstrap(*, root=None, upgrade=False, user=False, | |
args = ["install", "--no-index", "--find-links", tmpdir] | ||
if root: | ||
args += ["--root", root] | ||
if prefix: | ||
args += ["--prefix", prefix] | ||
if upgrade: | ||
args += ["--upgrade"] | ||
if user: | ||
|
@@ -183,6 +185,11 @@ def _main(argv=None): | |
default=None, | ||
help="Install everything relative to this alternate root directory.", | ||
) | ||
parser.add_argument( | ||
"--prefix", | ||
default=None, | ||
help="Install everything using this prefix.", | ||
) | ||
parser.add_argument( | ||
"--altinstall", | ||
action="store_true", | ||
|
@@ -202,6 +209,7 @@ def _main(argv=None): | |
|
||
return _bootstrap( | ||
root=args.root, | ||
prefix=args.prefix, | ||
upgrade=args.upgrade, | ||
user=args.user, | ||
verbosity=args.verbosity, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
A directory prefix can now be specified when using :mod:`ensurepip`. | ||
erlend-aasland marked this conversation as resolved.
Show resolved
Hide resolved
|
Uh oh!
There was an error while loading. Please reload this page.