@@ -95,8 +95,7 @@ def test_wheel_c_extension(project: str, exptected_c_dir: str) -> None:
95
95
assert re .search (r"\s+extended/extended.*\.(so|pyd)" , record ) is not None
96
96
97
97
# Files in RECORD should match files in wheel.
98
- zip_files = sorted (zipf .namelist ())
99
- assert zip_files == sorted (record_files )
98
+ assert zipf .namelist () == record_files
100
99
assert len (set (record_files )) == len (record_files )
101
100
102
101
@@ -119,23 +118,30 @@ def test_complete(no_vcs: bool) -> None:
119
118
if sys .platform != "win32" :
120
119
assert (os .stat (str (whl )).st_mode & 0o777 ) == 0o644
121
120
122
- expected_name_list = [
123
- "my_package/__init__.py" ,
124
- "my_package/data1/test.json" ,
125
- "my_package/sub_pkg1/__init__.py" ,
126
- "my_package/sub_pkg2/__init__.py" ,
127
- "my_package/sub_pkg2/data2/data.json" ,
128
- "my_package-1.2.3.data/scripts/script.sh" ,
129
- "my_package/sub_pkg3/foo.py" ,
130
- "my_package-1.2.3.dist-info/entry_points.txt" ,
131
- "my_package-1.2.3.dist-info/LICENSE" ,
132
- "my_package-1.2.3.dist-info/WHEEL" ,
133
- "my_package-1.2.3.dist-info/METADATA" ,
134
- "my_package-1.2.3.dist-info/RECORD" ,
135
- ]
121
+ expected_name_list = (
122
+ [
123
+ "my_package/__init__.py" ,
124
+ "my_package/data1/test.json" ,
125
+ "my_package/sub_pkg1/__init__.py" ,
126
+ "my_package/sub_pkg2/__init__.py" ,
127
+ "my_package/sub_pkg2/data2/data.json" ,
128
+ "my_package/sub_pkg3/foo.py" ,
129
+ "my_package-1.2.3.data/scripts/script.sh" ,
130
+ ]
131
+ + sorted (
132
+ [
133
+ "my_package-1.2.3.dist-info/entry_points.txt" ,
134
+ "my_package-1.2.3.dist-info/LICENSE" ,
135
+ "my_package-1.2.3.dist-info/METADATA" ,
136
+ "my_package-1.2.3.dist-info/WHEEL" ,
137
+ ],
138
+ key = lambda x : Path (x ),
139
+ )
140
+ + ["my_package-1.2.3.dist-info/RECORD" ]
141
+ )
136
142
137
143
with zipfile .ZipFile (str (whl )) as zipf :
138
- assert sorted ( zipf .namelist ()) == sorted ( expected_name_list )
144
+ assert zipf .namelist () == expected_name_list
139
145
assert (
140
146
"Hello World"
141
147
in zipf .read ("my_package-1.2.3.data/scripts/script.sh" ).decode ()
@@ -208,12 +214,11 @@ def test_complete(no_vcs: bool) -> None:
208
214
)
209
215
actual_records = zipf .read ("my_package-1.2.3.dist-info/RECORD" ).decode ()
210
216
211
- # For some reason, the ordering of the files and the SHA hashes
212
- # vary per operating systems and Python versions.
217
+ # The SHA hashes vary per operating systems.
213
218
# So instead of 1:1 assertion, let's do a bit clunkier one:
214
219
actual_files = [row [0 ] for row in csv .reader (actual_records .splitlines ())]
215
220
216
- assert sorted ( actual_files ) == sorted ( expected_name_list )
221
+ assert actual_files == expected_name_list
217
222
218
223
219
224
def test_module_src () -> None :
0 commit comments