mirror of https://github.com/pypa/pip
Set sys.argv[0] to the underlying setup.py in the setuptools shim.
This commit is contained in:
parent
d641b54436
commit
b47da272aa
|
@ -0,0 +1,2 @@
|
|||
Set ``sys.argv[0]`` to the underlying ``setup.py`` when invoking ``setup.py``
|
||||
via the setuptools shim so setuptools doesn't think the path is ``-c``.
|
|
@ -595,7 +595,7 @@ class InstallRequirement(object):
|
|||
'Running setup.py (path:%s) egg_info for package from %s',
|
||||
self.setup_py_path, self.link,
|
||||
)
|
||||
script = SETUPTOOLS_SHIM % self.setup_py_path
|
||||
script = SETUPTOOLS_SHIM.format(self.setup_py_path)
|
||||
base_cmd = [sys.executable, '-c', script]
|
||||
if self.isolated:
|
||||
base_cmd += ["--no-user-cfg"]
|
||||
|
@ -757,7 +757,7 @@ class InstallRequirement(object):
|
|||
[
|
||||
sys.executable,
|
||||
'-c',
|
||||
SETUPTOOLS_SHIM % self.setup_py_path
|
||||
SETUPTOOLS_SHIM.format(self.setup_py_path)
|
||||
] +
|
||||
list(global_options) +
|
||||
['develop', '--no-deps'] +
|
||||
|
@ -1004,7 +1004,7 @@ class InstallRequirement(object):
|
|||
# type: (...) -> List[str]
|
||||
install_args = [sys.executable, "-u"]
|
||||
install_args.append('-c')
|
||||
install_args.append(SETUPTOOLS_SHIM % self.setup_py_path)
|
||||
install_args.append(SETUPTOOLS_SHIM.format(self.setup_py_path))
|
||||
install_args += list(global_options) + \
|
||||
['install', '--record', record_filename]
|
||||
install_args += ['--single-version-externally-managed']
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
# Shim to wrap setup.py invocation with setuptools
|
||||
#
|
||||
# We set sys.argv[0] to the path to the underlying setup.py file so
|
||||
# setuptools / distutils don't take the path to the setup.py to be "-c" when
|
||||
# invoking via the shim. This avoids e.g. the following manifest_maker
|
||||
# warning: "warning: manifest_maker: standard file '-c' not found".
|
||||
SETUPTOOLS_SHIM = (
|
||||
"import setuptools, tokenize;__file__=%r;"
|
||||
"import sys, setuptools, tokenize; sys.argv[0] = {0!r}; __file__={0!r};"
|
||||
"f=getattr(tokenize, 'open', open)(__file__);"
|
||||
"code=f.read().replace('\\r\\n', '\\n');"
|
||||
"f.close();"
|
||||
|
|
|
@ -930,7 +930,7 @@ class WheelBuilder(object):
|
|||
# virtualenv.
|
||||
return [
|
||||
sys.executable, '-u', '-c',
|
||||
SETUPTOOLS_SHIM % req.setup_py_path,
|
||||
SETUPTOOLS_SHIM.format(req.setup_py_path)
|
||||
] + list(self.global_options)
|
||||
|
||||
def _build_one_pep517(self, req, tempd, python_tag=None):
|
||||
|
|
Loading…
Reference in New Issue