Skip to content

Commit

Permalink
Merge pull request #8537 from chrahunt/refactor/read-record-from-wheel
Browse files Browse the repository at this point in the history
Read RECORD from wheel file directly during install
  • Loading branch information
chrahunt authored Jul 4, 2020
2 parents 196f548 + d7b5a77 commit feb2a24
Showing 1 changed file with 5 additions and 4 deletions.
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 @@ -659,10 +659,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 @@ -671,6 +669,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

0 comments on commit feb2a24

Please sign in to comment.