File tree 2 files changed +9
-17
lines changed
2 files changed +9
-17
lines changed Original file line number Diff line number Diff line change @@ -609,20 +609,13 @@ def test_wheel_no_dist_dir():
609
609
610
610
def test_wheel_is_compatible (monkeypatch ):
611
611
def sys_tags ():
612
- for t in parse_tag ('cp36-cp36m-manylinux1_x86_64' ):
613
- yield t
614
- monkeypatch .setattr ('setuptools.wheel.sys_tags' , sys_tags )
615
- # Clear the supported tags cache, otherwise the sys_tags monkeypatch
616
- # has no effect.
617
- setuptools .wheel ._supported_tags .cache_clear ()
618
- try :
619
- assert Wheel (
620
- 'onnxruntime-0.1.2-cp36-cp36m-manylinux1_x86_64.whl'
621
- ).is_compatible ()
622
- finally :
623
- # Clear the cache again, otherwise the sys_tags monkeypatch
624
- # is still in effect for the rest of the tests.
625
- setuptools .wheel ._supported_tags .cache_clear ()
612
+ return {
613
+ (t .interpreter , t .abi , t .platform )
614
+ for t in parse_tag ('cp36-cp36m-manylinux1_x86_64' )
615
+ }
616
+ monkeypatch .setattr ('setuptools.wheel._get_supported_tags' , sys_tags )
617
+ assert Wheel (
618
+ 'onnxruntime-0.1.2-cp36-cp36m-manylinux1_x86_64.whl' ).is_compatible ()
626
619
627
620
628
621
def test_wheel_mode ():
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ def _get_supported_tags():
34
34
# We calculate the supported tags only once, otherwise calling
35
35
# this method on thousands of wheels takes seconds instead of
36
36
# milliseconds.
37
- return set (( t .interpreter , t .abi , t .platform ) for t in sys_tags ())
37
+ return {( t .interpreter , t .abi , t .platform ) for t in sys_tags ()}
38
38
39
39
40
40
def unpack (src_dir , dst_dir ):
@@ -92,8 +92,7 @@ def tags(self):
92
92
93
93
def is_compatible (self ):
94
94
'''Is the wheel compatible with the current platform?'''
95
- _supported_tags = _get_supported_tags ()
96
- return next ((True for t in self .tags () if t in _supported_tags ), False )
95
+ return next ((True for t in self .tags () if t in _get_supported_tags ()), False )
97
96
98
97
def egg_name (self ):
99
98
return _egg_basename (
You can’t perform that action at this time.
0 commit comments