13
13
14
14
import pytest
15
15
16
+ from python_inspector import utils_pypi
16
17
from python_inspector .utils_pypi import Distribution
18
+ from python_inspector .utils_pypi import PypiPackage
17
19
from python_inspector .utils_pypi import Sdist
18
20
from python_inspector .utils_pypi import Wheel
19
21
@@ -138,6 +140,15 @@ def check(self, using=Distribution):
138
140
),
139
141
]
140
142
143
+ linux_platforms = [
144
+ "linux_x86_64" ,
145
+ "manylinux1_x86_64" ,
146
+ "manylinux2010_x86_64" ,
147
+ "manylinux2014_x86_64" ,
148
+ "manylinux_2_27_x86_64" ,
149
+ "manylinux_2_28_x86_64" ,
150
+ ]
151
+
141
152
142
153
@pytest .mark .parametrize ("dist_test" , sdist_tests + wheel_tests )
143
154
def test_Distribution_from_filename (dist_test ):
@@ -152,3 +163,14 @@ def test_Sdist_from_filename(dist_test):
152
163
@pytest .mark .parametrize ("dist_test" , wheel_tests )
153
164
def test_Wheel_from_filename (dist_test ):
154
165
dist_test .check (using = Wheel )
166
+
167
+
168
+ @pytest .mark .parametrize ("linux_platform" , linux_platforms )
169
+ def test_PypiPackage_get_supported_wheels (linux_platform ):
170
+ whl = Wheel .from_filename (f"onnxruntime-1.19.2-cp311-cp311-{ linux_platform } .whl" )
171
+ pkg = PypiPackage .package_from_dists (dists = [whl ])
172
+ env = utils_pypi .Environment .from_pyver_and_os (python_version = "311" , operating_system = "linux" )
173
+
174
+ supported_wheels = list (pkg .get_supported_wheels (environment = env ))
175
+
176
+ assert supported_wheels == [whl ]
0 commit comments