@@ -137,6 +137,7 @@ def test_manual_abi_dm_flags(self):
137
137
@pytest .mark .parametrize ('is_manylinux_compatible' , [
138
138
pep425tags .is_manylinux1_compatible ,
139
139
pep425tags .is_manylinux2010_compatible ,
140
+ pep425tags .is_manylinux2014_compatible ,
140
141
])
141
142
class TestManylinuxTags (object ):
142
143
"""
@@ -156,28 +157,28 @@ def test_manylinux_compatible_on_linux_x86_64(self,
156
157
@patch ('pip._internal.pep425tags.get_platform' , lambda : 'linux_i686' )
157
158
@patch ('pip._internal.utils.glibc.have_compatible_glibc' ,
158
159
lambda major , minor : True )
159
- def test_manylinux1_compatible_on_linux_i686 (self ,
160
- is_manylinux_compatible ):
160
+ def test_manylinux_compatible_on_linux_i686 (self ,
161
+ is_manylinux_compatible ):
161
162
"""
162
- Test that manylinux1 is enabled on linux_i686
163
+ Test that manylinuxes are enabled on linux_i686
163
164
"""
164
165
assert is_manylinux_compatible ()
165
166
166
167
@patch ('pip._internal.pep425tags.get_platform' , lambda : 'linux_x86_64' )
167
168
@patch ('pip._internal.utils.glibc.have_compatible_glibc' ,
168
169
lambda major , minor : False )
169
- def test_manylinux1_2 (self , is_manylinux_compatible ):
170
+ def test_manylinux_2 (self , is_manylinux_compatible ):
170
171
"""
171
- Test that manylinux1 is disabled with incompatible glibc
172
+ Test that manylinuxes are disabled with incompatible glibc
172
173
"""
173
174
assert not is_manylinux_compatible ()
174
175
175
176
@patch ('pip._internal.pep425tags.get_platform' , lambda : 'arm6vl' )
176
177
@patch ('pip._internal.utils.glibc.have_compatible_glibc' ,
177
178
lambda major , minor : True )
178
- def test_manylinux1_3 (self , is_manylinux_compatible ):
179
+ def test_manylinux_3 (self , is_manylinux_compatible ):
179
180
"""
180
- Test that manylinux1 is disabled on arm6vl
181
+ Test that manylinuxes are disabled on arm6vl
181
182
"""
182
183
assert not is_manylinux_compatible ()
183
184
@@ -186,6 +187,8 @@ class TestManylinux1Tags(object):
186
187
187
188
@patch ('pip._internal.pep425tags.is_manylinux2010_compatible' ,
188
189
lambda : False )
190
+ @patch ('pip._internal.pep425tags.is_manylinux2014_compatible' ,
191
+ lambda : False )
189
192
@patch ('pip._internal.pep425tags.get_platform' , lambda : 'linux_x86_64' )
190
193
@patch ('pip._internal.utils.glibc.have_compatible_glibc' ,
191
194
lambda major , minor : True )
@@ -210,6 +213,8 @@ def test_manylinux1_tag_is_first(self):
210
213
211
214
class TestManylinux2010Tags (object ):
212
215
216
+ @patch ('pip._internal.pep425tags.is_manylinux2014_compatible' ,
217
+ lambda : False )
213
218
@patch ('pip._internal.pep425tags.get_platform' , lambda : 'linux_x86_64' )
214
219
@patch ('pip._internal.utils.glibc.have_compatible_glibc' ,
215
220
lambda major , minor : True )
@@ -253,3 +258,55 @@ def test_manylinux2010_implies_manylinux1(self, manylinux2010, manylinux1):
253
258
if arches == ['any' ]:
254
259
continue
255
260
assert arches [:2 ] == [manylinux2010 , manylinux1 ]
261
+
262
+
263
+ class TestManylinux2014Tags (object ):
264
+
265
+ @patch ('pip._internal.pep425tags.get_platform' , lambda : 'linux_x86_64' )
266
+ @patch ('pip._internal.utils.glibc.have_compatible_glibc' ,
267
+ lambda major , minor : True )
268
+ @patch ('sys.platform' , 'linux2' )
269
+ def test_manylinux2014_tag_is_first (self ):
270
+ """
271
+ Test that the more specific tag manylinux2014 comes first.
272
+ """
273
+ groups = {}
274
+ for pyimpl , abi , arch in pep425tags .get_supported ():
275
+ groups .setdefault ((pyimpl , abi ), []).append (arch )
276
+
277
+ for arches in groups .values ():
278
+ if arches == ['any' ]:
279
+ continue
280
+ # Expect the most specific arch first:
281
+ if len (arches ) == 5 :
282
+ assert arches == ['manylinux2014_x86_64' ,
283
+ 'manylinux2010_x86_64' ,
284
+ 'manylinux1_x86_64' ,
285
+ 'linux_x86_64' ,
286
+ 'any' ]
287
+ else :
288
+ assert arches == ['manylinux2014_x86_64' ,
289
+ 'manylinux2010_x86_64' ,
290
+ 'manylinux1_x86_64' ,
291
+ 'linux_x86_64' ]
292
+
293
+ @pytest .mark .parametrize ("manylinuxA,manylinuxB" , [
294
+ ("manylinux2014_x86_64" , ["manylinux2010_x86_64" ,
295
+ "manylinux1_x86_64" ]),
296
+ ("manylinux2014_i686" , ["manylinux2010_i686" , "manylinux1_i686" ]),
297
+ ])
298
+ def test_manylinuxA_implies_manylinuxB (self , manylinuxA , manylinuxB ):
299
+ """
300
+ Specifying manylinux2014 implies manylinux2010/manylinux1.
301
+ """
302
+ groups = {}
303
+ supported = pep425tags .get_supported (platform = manylinuxA )
304
+ for pyimpl , abi , arch in supported :
305
+ groups .setdefault ((pyimpl , abi ), []).append (arch )
306
+
307
+ expected_arches = [manylinuxA ]
308
+ expected_arches .extend (manylinuxB )
309
+ for arches in groups .values ():
310
+ if arches == ['any' ]:
311
+ continue
312
+ assert arches [:3 ] == expected_arches
0 commit comments