Skip to content

Record pip in INSTALLER file #3284

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

Merged
merged 1 commit into from
Jan 19, 2016
Merged
Show file tree
Hide file tree
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: 9 additions & 0 deletions pip/wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,15 @@ def _get_script_text(entry):
)
)

# Record pip as the installer
installer = os.path.join(info_dir[0], 'INSTALLER')
temp_installer = os.path.join(info_dir[0], 'INSTALLER.pip')
with open(temp_installer, 'wb') as installer_file:
installer_file.write(b'pip\n')
shutil.move(temp_installer, installer)
generated.append(installer)

# Record details of all files installed
record = os.path.join(info_dir[0], 'RECORD')
temp_record = os.path.join(info_dir[0], 'RECORD.pip')
with open_for_csv(record, 'r') as record_in:
Expand Down
11 changes: 11 additions & 0 deletions tests/functional/test_install_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,17 @@ def test_install_from_wheel_file(script, data):
assert dist_info_folder in result.files_created, (dist_info_folder,
result.files_created,
result.stdout)
installer = dist_info_folder / 'INSTALLER'
assert installer in result.files_created, (dist_info_folder,
result.files_created,
result.stdout)
with open(script.base_path / installer, 'rb') as installer_file:
installer_details = installer_file.read()
assert installer_details == b'pip\n'
installer_temp = dist_info_folder / 'INSTALLER.pip'
assert installer_temp not in result.files_created, (dist_info_folder,
result.files_created,
result.stdout)


# header installs are broke in pypy virtualenvs
Expand Down