|
34 | 34 | if sys.platform in {'win32', 'cygwin'}:
|
35 | 35 | EXT_IMP_SUFFIX = re.sub(r'.(pyd|dll)$', '.lib' if shutil.which('cl.exe') else '.dll.a', EXT_SUFFIX)
|
36 | 36 |
|
| 37 | +LIB_SUFFIX = { |
| 38 | + 'cygwin': '.dll', |
| 39 | + 'darwin': '.dylib', |
| 40 | + 'linux': '.so', |
| 41 | + 'win32': '.dll', |
| 42 | +}[sys.platform] |
| 43 | + |
37 | 44 | # Test against the wheel tag generated by packaging module.
|
38 | 45 | tag = next(packaging.tags.sys_tags())
|
39 | 46 | ABI = tag.abi
|
@@ -137,16 +144,14 @@ def test_contents_license_file(wheel_license_file):
|
137 | 144 | def test_contents(package_library, wheel_library):
|
138 | 145 | artifact = wheel.wheelfile.WheelFile(wheel_library)
|
139 | 146 |
|
140 |
| - for name, regex in zip(sorted(wheel_contents(artifact)), [ |
141 |
| - re.escape('.library.mesonpy.libs/libexample.so'), |
142 |
| - re.escape('library-1.0.0.data/headers/examplelib.h'), |
143 |
| - re.escape('library-1.0.0.data/scripts/example'), |
144 |
| - re.escape('library-1.0.0.dist-info/METADATA'), |
145 |
| - re.escape('library-1.0.0.dist-info/RECORD'), |
146 |
| - re.escape('library-1.0.0.dist-info/WHEEL'), |
147 |
| - re.escape('library.libs/libexample.so'), |
148 |
| - ]): |
149 |
| - assert re.match(regex, name), f'{name!r} does not match {regex!r}' |
| 147 | + assert wheel_contents(artifact) == { |
| 148 | + f'.library.mesonpy.libs/libexample{LIB_SUFFIX}', |
| 149 | + 'library-1.0.0.data/headers/examplelib.h', |
| 150 | + 'library-1.0.0.data/scripts/example', |
| 151 | + 'library-1.0.0.dist-info/METADATA', |
| 152 | + 'library-1.0.0.dist-info/RECORD', |
| 153 | + 'library-1.0.0.dist-info/WHEEL', |
| 154 | + } |
150 | 155 |
|
151 | 156 |
|
152 | 157 | @pytest.mark.skipif(platform.system() not in {'Linux', 'Darwin'}, reason='Not supported on this platform')
|
|
0 commit comments