Skip to content

Commit

Permalink
handle compressed tag sets
Browse files Browse the repository at this point in the history
  • Loading branch information
jakelishman committed Sep 23, 2024
1 parent 603e856 commit 4070f76
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions test/qpy_compat/get_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,16 @@
import qiskit


def tag_from_wheel_name(wheel: str) -> packaging.tags.Tag:
def tags_from_wheel_name(wheel: str):
"""Extract the wheel tag from its filename."""
assert wheel.lower().endswith(".whl")
_prefix, interpreter, abi, platform = wheel[:-4].rsplit("-", 3)
return packaging.tags.Tag(interpreter, abi, platform)
_prefix, interpreters, abis, platforms = wheel[:-4].rsplit("-", 3)
yield from (
packaging.tags.Tag(interpreter, abi, platform)
for interpreter in interpreters.split(".")
for abi in abis.split(".")
for platform in platforms.split(".")
)


def available_versions():
Expand All @@ -52,9 +57,10 @@ def available_versions_for_package(package, min_version=None, max_version=None):
# Python version that's too new, which can be a problem for the oldest Terras,
# especially from before we built for abi3.
if not any(
tag_from_wheel_name(release["filename"]) in supported_tags
tag in supported_tags
for release in payload
if release["packagetype"] == "bdist_wheel"
for tag in tags_from_wheel_name(release["filename"])
):
print(
f"skipping '{other_version}', which has no installable binary artifacts",
Expand Down

0 comments on commit 4070f76

Please sign in to comment.