mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Merge pull request #8526 from chrahunt/reduce-dependence-on-files
Reduce dependence on disk files during Wheel installation
This commit is contained in:
commit
ea7ee7d8e0
|
@ -354,9 +354,6 @@ def install_unpacked_wheel(
|
||||||
else:
|
else:
|
||||||
lib_dir = scheme.platlib
|
lib_dir = scheme.platlib
|
||||||
|
|
||||||
subdirs = os.listdir(source)
|
|
||||||
data_dirs = [s for s in subdirs if s.endswith('.data')]
|
|
||||||
|
|
||||||
# Record details of the files moved
|
# Record details of the files moved
|
||||||
# installed = files copied from the wheel to the destination
|
# installed = files copied from the wheel to the destination
|
||||||
# changed = files changed while installing (scripts #! line typically)
|
# changed = files changed while installing (scripts #! line typically)
|
||||||
|
@ -473,6 +470,10 @@ def install_unpacked_wheel(
|
||||||
# Ignore setuptools-generated scripts
|
# Ignore setuptools-generated scripts
|
||||||
return (matchname in console or matchname in gui)
|
return (matchname in console or matchname in gui)
|
||||||
|
|
||||||
|
# Zip file path separators must be /
|
||||||
|
subdirs = set(p.split("/", 1)[0] for p in wheel_zip.namelist())
|
||||||
|
data_dirs = [s for s in subdirs if s.endswith('.data')]
|
||||||
|
|
||||||
for datadir in data_dirs:
|
for datadir in data_dirs:
|
||||||
fixer = None
|
fixer = None
|
||||||
filter = None
|
filter = None
|
||||||
|
@ -481,10 +482,12 @@ def install_unpacked_wheel(
|
||||||
if subdir == 'scripts':
|
if subdir == 'scripts':
|
||||||
fixer = fix_script
|
fixer = fix_script
|
||||||
filter = is_entrypoint_wrapper
|
filter = is_entrypoint_wrapper
|
||||||
source = os.path.join(wheeldir, datadir, subdir)
|
full_datadir_path = os.path.join(wheeldir, datadir, subdir)
|
||||||
dest = getattr(scheme, subdir)
|
dest = getattr(scheme, subdir)
|
||||||
clobber(
|
clobber(
|
||||||
ensure_text(source, encoding=sys.getfilesystemencoding()),
|
ensure_text(
|
||||||
|
full_datadir_path, encoding=sys.getfilesystemencoding()
|
||||||
|
),
|
||||||
ensure_text(dest, encoding=sys.getfilesystemencoding()),
|
ensure_text(dest, encoding=sys.getfilesystemencoding()),
|
||||||
False,
|
False,
|
||||||
fixer=fixer,
|
fixer=fixer,
|
||||||
|
|
Loading…
Reference in a new issue