@@ -85,22 +85,6 @@ def test_scipy_like(wheel_scipy_like):
85
85
assert name .group ('plat' ) == PLATFORM
86
86
87
87
88
- @pytest .mark .skipif (platform .system () != 'Linux' , reason = 'Needs library vendoring, only implemented in POSIX' )
89
- def test_contents (package_library , wheel_library ):
90
- artifact = wheel .wheelfile .WheelFile (wheel_library )
91
-
92
- for name , regex in zip (sorted (wheel_contents (artifact )), [
93
- re .escape ('.library.mesonpy.libs/libexample.so' ),
94
- re .escape ('library-1.0.0.data/headers/examplelib.h' ),
95
- re .escape ('library-1.0.0.data/scripts/example' ),
96
- re .escape ('library-1.0.0.dist-info/METADATA' ),
97
- re .escape ('library-1.0.0.dist-info/RECORD' ),
98
- re .escape ('library-1.0.0.dist-info/WHEEL' ),
99
- re .escape ('library.libs/libexample.so' ),
100
- ]):
101
- assert re .match (regex , name ), f'{ name !r} does not match { regex !r} '
102
-
103
-
104
88
def test_purelib_and_platlib (wheel_purelib_and_platlib ):
105
89
artifact = wheel .wheelfile .WheelFile (wheel_purelib_and_platlib )
106
90
@@ -144,47 +128,35 @@ def test_configure_data(wheel_configure_data):
144
128
}
145
129
146
130
147
- @pytest .mark .skipif (platform .system () not in ['Linux' , 'Darwin' ], reason = 'Unsupported on this platform for now' )
148
- def test_local_lib (venv , wheel_link_against_local_lib ):
149
- venv .pip ('install' , wheel_link_against_local_lib )
150
- output = venv .python ('-c' , 'import example; print(example.example_sum(1, 2))' )
151
- assert int (output ) == 3
152
-
153
-
154
131
def test_contents_license_file (wheel_license_file ):
155
132
artifact = wheel .wheelfile .WheelFile (wheel_license_file )
156
133
assert artifact .read ('license_file-1.0.0.dist-info/LICENSE.custom' ).rstrip () == b'Hello!'
157
134
158
135
159
- @pytest .mark .skipif (sys .platform in {'win32' , 'cygwin' }, reason = 'Platform does not support executable bit' )
160
- def test_executable_bit (wheel_executable_bit ):
161
- artifact = wheel .wheelfile .WheelFile (wheel_executable_bit )
162
-
163
- executable_files = {
164
- 'executable_bit-1.0.0.data/purelib/executable_module.py' ,
165
- 'executable_bit-1.0.0.data/scripts/example' ,
166
- 'executable_bit-1.0.0.data/scripts/example-script' ,
167
- }
168
- for info in artifact .infolist ():
169
- mode = (info .external_attr >> 16 ) & 0o777
170
- assert bool (mode & stat .S_IXUSR ) == (info .filename in executable_files )
171
-
136
+ @pytest .mark .skipif (platform .system () not in {'Linux' , 'Darwin' }, reason = 'Not supported on this platform' )
137
+ def test_contents (package_library , wheel_library ):
138
+ artifact = wheel .wheelfile .WheelFile (wheel_library )
172
139
173
- def test_detect_wheel_tag_module (wheel_purelib_and_platlib ):
174
- name = wheel .wheelfile .WheelFile (wheel_purelib_and_platlib ).parsed_filename
175
- assert name .group ('pyver' ) == INTERPRETER
176
- assert name .group ('abi' ) == ABI
177
- assert name .group ('plat' ) == PLATFORM
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} '
178
150
179
151
180
- def test_detect_wheel_tag_script ( wheel_executable ):
181
- name = wheel . wheelfile . WheelFile ( wheel_executable ). parsed_filename
182
- assert name . group ( 'pyver' ) == 'py3'
183
- assert name . group ( 'abi' ) == 'none'
184
- assert name . group ( 'plat' ) == PLATFORM
152
+ @ pytest . mark . skipif ( platform . system () not in { 'Linux' , 'Darwin' }, reason = 'Not supported on this platform' )
153
+ def test_local_lib ( venv , wheel_link_against_local_lib ):
154
+ venv . pip ( 'install' , wheel_link_against_local_lib )
155
+ output = venv . python ( '-c' , 'import example; print(example.example_sum(1, 2))' )
156
+ assert int ( output ) == 3
185
157
186
158
187
- @pytest .mark .skipif (platform .system () not in [ 'Linux' , 'Darwin' ] , reason = 'Unsupported on this platform for now ' )
159
+ @pytest .mark .skipif (platform .system () not in { 'Linux' , 'Darwin' } , reason = 'Not supported on this platform' )
188
160
def test_rpath (wheel_link_against_local_lib , tmp_path ):
189
161
artifact = wheel .wheelfile .WheelFile (wheel_link_against_local_lib )
190
162
artifact .extractall (tmp_path )
@@ -197,7 +169,7 @@ def test_rpath(wheel_link_against_local_lib, tmp_path):
197
169
assert '@loader_path/.link_against_local_lib.mesonpy.libs' in dylib .rpath
198
170
199
171
200
- @pytest .mark .skipif (platform .system () not in [ 'Linux' , 'Darwin' ] , reason = 'Unsupported on this platform for now ' )
172
+ @pytest .mark .skipif (platform .system () not in { 'Linux' , 'Darwin' } , reason = 'Not supported on this platform' )
201
173
def test_uneeded_rpath (wheel_purelib_and_platlib , tmp_path ):
202
174
artifact = wheel .wheelfile .WheelFile (wheel_purelib_and_platlib )
203
175
artifact .extractall (tmp_path )
@@ -213,6 +185,34 @@ def test_uneeded_rpath(wheel_purelib_and_platlib, tmp_path):
213
185
assert 'mesonpy.libs' not in rpath
214
186
215
187
188
+ @pytest .mark .skipif (platform .system () not in {'Linux' , 'Darwin' }, reason = 'Not supported on this platform' )
189
+ def test_executable_bit (wheel_executable_bit ):
190
+ artifact = wheel .wheelfile .WheelFile (wheel_executable_bit )
191
+
192
+ executable_files = {
193
+ 'executable_bit-1.0.0.data/purelib/executable_module.py' ,
194
+ 'executable_bit-1.0.0.data/scripts/example' ,
195
+ 'executable_bit-1.0.0.data/scripts/example-script' ,
196
+ }
197
+ for info in artifact .infolist ():
198
+ mode = (info .external_attr >> 16 ) & 0o777
199
+ assert bool (mode & stat .S_IXUSR ) == (info .filename in executable_files )
200
+
201
+
202
+ def test_detect_wheel_tag_module (wheel_purelib_and_platlib ):
203
+ name = wheel .wheelfile .WheelFile (wheel_purelib_and_platlib ).parsed_filename
204
+ assert name .group ('pyver' ) == INTERPRETER
205
+ assert name .group ('abi' ) == ABI
206
+ assert name .group ('plat' ) == PLATFORM
207
+
208
+
209
+ def test_detect_wheel_tag_script (wheel_executable ):
210
+ name = wheel .wheelfile .WheelFile (wheel_executable ).parsed_filename
211
+ assert name .group ('pyver' ) == 'py3'
212
+ assert name .group ('abi' ) == 'none'
213
+ assert name .group ('plat' ) == PLATFORM
214
+
215
+
216
216
def test_entrypoints (wheel_full_metadata ):
217
217
artifact = wheel .wheelfile .WheelFile (wheel_full_metadata )
218
218
0 commit comments