1313
1414import pytest
1515
16+ from python_inspector import utils_pypi
1617from python_inspector .utils_pypi import Distribution
18+ from python_inspector .utils_pypi import PypiPackage
1719from python_inspector .utils_pypi import Sdist
1820from python_inspector .utils_pypi import Wheel
1921
@@ -138,6 +140,15 @@ def check(self, using=Distribution):
138140 ),
139141]
140142
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+
141152
142153@pytest .mark .parametrize ("dist_test" , sdist_tests + wheel_tests )
143154def test_Distribution_from_filename (dist_test ):
@@ -152,3 +163,14 @@ def test_Sdist_from_filename(dist_test):
152163@pytest .mark .parametrize ("dist_test" , wheel_tests )
153164def test_Wheel_from_filename (dist_test ):
154165 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