Skip to content

Bugfix: support packages that only have manylinux 2 wheels #191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/python_inspector/utils_pypi.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ def get_python_dot_version(version):
"manylinux1_x86_64",
"manylinux2010_x86_64",
"manylinux2014_x86_64",
"manylinux_2_27_x86_64",
"manylinux_2_28_x86_64",
"manylinux2014_aarch6",
"musllinux_1_2_x86_64",
"manylinux_2_33_aarch64",
Expand Down
22 changes: 22 additions & 0 deletions tests/test_utils_pypi.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@

import pytest

from python_inspector import utils_pypi
from python_inspector.utils_pypi import Distribution
from python_inspector.utils_pypi import PypiPackage
from python_inspector.utils_pypi import Sdist
from python_inspector.utils_pypi import Wheel

Expand Down Expand Up @@ -138,6 +140,15 @@ def check(self, using=Distribution):
),
]

linux_platforms = [
"linux_x86_64",
"manylinux1_x86_64",
"manylinux2010_x86_64",
"manylinux2014_x86_64",
"manylinux_2_27_x86_64",
"manylinux_2_28_x86_64",
]


@pytest.mark.parametrize("dist_test", sdist_tests + wheel_tests)
def test_Distribution_from_filename(dist_test):
Expand All @@ -152,3 +163,14 @@ def test_Sdist_from_filename(dist_test):
@pytest.mark.parametrize("dist_test", wheel_tests)
def test_Wheel_from_filename(dist_test):
dist_test.check(using=Wheel)


@pytest.mark.parametrize("linux_platform", linux_platforms)
def test_PypiPackage_get_supported_wheels(linux_platform):
whl = Wheel.from_filename(f"onnxruntime-1.19.2-cp311-cp311-{linux_platform}.whl")
pkg = PypiPackage.package_from_dists(dists=[whl])
env = utils_pypi.Environment.from_pyver_and_os(python_version="311", operating_system="linux")

supported_wheels = list(pkg.get_supported_wheels(environment=env))

assert supported_wheels == [whl]
Loading