77from pip ._internal import pep425tags
88
99
10- @pytest .mark .parametrize ('file_tag, expected' , [
11- (('py27' , 'none' , 'any' ), 'py27-none-any' ),
12- (('cp33' , 'cp32dmu' , 'linux_x86_64' ), 'cp33-cp32dmu-linux_x86_64' ),
13- ])
14- def test_format_tag (file_tag , expected ):
15- actual = pep425tags .format_tag (file_tag )
16- assert actual == expected
17-
18-
1910@pytest .mark .parametrize ('version_info, expected' , [
2011 ((2 ,), '2' ),
2112 ((2 , 8 ), '28' ),
@@ -98,10 +89,10 @@ def test_no_hyphen_tag(self):
9889 mock_gcf ):
9990 supported = pip ._internal .pep425tags .get_supported ()
10091
101- for ( py , abi , plat ) in supported :
102- assert '-' not in py
103- assert '-' not in abi
104- assert '-' not in plat
92+ for tag in supported :
93+ assert '-' not in tag . interpreter
94+ assert '-' not in tag . abi
95+ assert '-' not in tag . platform
10596
10697 def test_manual_abi_noflags (self ):
10798 """
@@ -192,8 +183,10 @@ def test_manylinux1_tag_is_first(self):
192183 Test that the more specific tag manylinux1 comes first.
193184 """
194185 groups = {}
195- for pyimpl , abi , arch in pep425tags .get_supported ():
196- groups .setdefault ((pyimpl , abi ), []).append (arch )
186+ for tag in pep425tags .get_supported ():
187+ groups .setdefault (
188+ (tag .interpreter , tag .abi ), []
189+ ).append (tag .platform )
197190
198191 for arches in groups .values ():
199192 if arches == ['any' ]:
@@ -218,8 +211,10 @@ def test_manylinux2010_tag_is_first(self):
218211 Test that the more specific tag manylinux2010 comes first.
219212 """
220213 groups = {}
221- for pyimpl , abi , arch in pep425tags .get_supported ():
222- groups .setdefault ((pyimpl , abi ), []).append (arch )
214+ for tag in pep425tags .get_supported ():
215+ groups .setdefault (
216+ (tag .interpreter , tag .abi ), []
217+ ).append (tag .platform )
223218
224219 for arches in groups .values ():
225220 if arches == ['any' ]:
@@ -245,8 +240,10 @@ def test_manylinux2010_implies_manylinux1(self, manylinux2010, manylinux1):
245240 """
246241 groups = {}
247242 supported = pep425tags .get_supported (platform = manylinux2010 )
248- for pyimpl , abi , arch in supported :
249- groups .setdefault ((pyimpl , abi ), []).append (arch )
243+ for tag in supported :
244+ groups .setdefault (
245+ (tag .interpreter , tag .abi ), []
246+ ).append (tag .platform )
250247
251248 for arches in groups .values ():
252249 if arches == ['any' ]:
@@ -265,8 +262,10 @@ def test_manylinux2014_tag_is_first(self):
265262 Test that the more specific tag manylinux2014 comes first.
266263 """
267264 groups = {}
268- for pyimpl , abi , arch in pep425tags .get_supported ():
269- groups .setdefault ((pyimpl , abi ), []).append (arch )
265+ for tag in pep425tags .get_supported ():
266+ groups .setdefault (
267+ (tag .interpreter , tag .abi ), []
268+ ).append (tag .platform )
270269
271270 for arches in groups .values ():
272271 if arches == ['any' ]:
@@ -295,8 +294,10 @@ def test_manylinuxA_implies_manylinuxB(self, manylinuxA, manylinuxB):
295294 """
296295 groups = {}
297296 supported = pep425tags .get_supported (platform = manylinuxA )
298- for pyimpl , abi , arch in supported :
299- groups .setdefault ((pyimpl , abi ), []).append (arch )
297+ for tag in supported :
298+ groups .setdefault (
299+ (tag .interpreter , tag .abi ), []
300+ ).append (tag .platform )
300301
301302 expected_arches = [manylinuxA ]
302303 expected_arches .extend (manylinuxB )
0 commit comments