Skip to content

Commit d1f953f

Browse files
committed
Bugfix: support packages that only have manylinux 2 wheels
Currently onnxruntime==1.19.2 cannot be analyzed with python-inspector, because get_supported_wheels() is unable to process packages that only have manylinux wheels. E.g. https://pypi.org/project/onnxruntime/#files only contains the file ' onnxruntime-1.19.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl' for the x86_64 architecture.
1 parent 869c412 commit d1f953f

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

src/python_inspector/utils_pypi.py

+2
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ def get_python_dot_version(version):
143143
"manylinux1_x86_64",
144144
"manylinux2010_x86_64",
145145
"manylinux2014_x86_64",
146+
"manylinux_2_27_x86_64",
147+
"manylinux_2_28_x86_64",
146148
],
147149
"macos": [
148150
"macosx_10_6_intel",

tests/test_utils_pypi.py

+22
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313

1414
import pytest
1515

16+
from python_inspector import utils_pypi
1617
from python_inspector.utils_pypi import Distribution
18+
from python_inspector.utils_pypi import PypiPackage
1719
from python_inspector.utils_pypi import Sdist
1820
from 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)
143154
def 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)
153164
def 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

Comments
 (0)