File tree 1 file changed +20
-5
lines changed 1 file changed +20
-5
lines changed Original file line number Diff line number Diff line change 1
1
import os
2
2
import pathlib
3
3
import re
4
+ import textwrap
4
5
5
6
from pip import __version__
6
7
from pip ._internal .commands .show import search_packages_info
7
8
from pip ._internal .utils .unpacking import untar_file
8
- from tests .lib import PipTestEnvironment , TestData , create_test_package_with_setup
9
+ from tests .lib import (
10
+ PipTestEnvironment ,
11
+ TestData ,
12
+ create_test_package_with_setup ,
13
+ pyversion ,
14
+ )
9
15
10
16
11
17
def test_basic_show (script : PipTestEnvironment ) -> None :
@@ -74,10 +80,19 @@ def test_show_with_files_from_legacy(
74
80
str (setuptools_record ),
75
81
cwd = source_dir ,
76
82
)
77
- write_installed_files_from_setuptools_record (
78
- setuptools_record .read_text ().splitlines (),
79
- root = None ,
80
- req_description = "simple==1.0" ,
83
+ # Emulate the installed-files.txt generation which previous pip version did
84
+ # after running setup.py install (write_installed_files_from_setuptools_record).
85
+ egg_info_dir = script .site_packages_path / f"simple-1.0-py{ pyversion } .egg-info"
86
+ egg_info_dir .joinpath ("installed-files.txt" ).write_text (
87
+ textwrap .dedent (
88
+ """\
89
+ ../simple/__init__.py
90
+ PKG-INFO
91
+ SOURCES.txt
92
+ dependency_links.txt
93
+ top_level.txt
94
+ """
95
+ )
81
96
)
82
97
83
98
result = script .pip ("show" , "--files" , "simple" )
You can’t perform that action at this time.
0 commit comments