Record pip in INSTALLER file

This commit is contained in:
Nick Coghlan 2015-12-04 19:19:17 +10:00
parent c20ed50a82
commit a925c88ed6
2 changed files with 20 additions and 0 deletions

View File

@ -496,6 +496,15 @@ if __name__ == '__main__':
)
)
# 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:

View File

@ -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