Skip to content
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

Read RECORD from wheel file directly during install #8537

Merged
merged 2 commits into from
Jul 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/pip/_internal/operations/install/wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,10 +644,8 @@ def _generate_file(path, **kwargs):
pass
generated.append(requested_path)

# Record details of all files installed
record_path = os.path.join(dest_info_dir, 'RECORD')
with open(record_path, **csv_io_kwargs('r')) as record_file:
record_rows = list(csv.reader(record_file))
record_text = distribution.get_metadata('RECORD')
record_rows = list(csv.reader(record_text.splitlines()))

rows = get_csv_rows_for_installed(
record_rows,
Expand All @@ -656,6 +654,9 @@ def _generate_file(path, **kwargs):
generated=generated,
lib_dir=lib_dir)

# Record details of all files installed
record_path = os.path.join(dest_info_dir, 'RECORD')

with _generate_file(record_path, **csv_io_kwargs('w')) as record_file:
# The type mypy infers for record_file is different for Python 3
# (typing.IO[Any]) and Python 2 (typing.BinaryIO). We explicitly
Expand Down