Skip to content

Commit 5eeca07

Browse files
committed
pylock select: make a set of supported tags
1 parent accb8a7 commit 5eeca07

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/packaging/pylock.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -674,8 +674,7 @@ def select(
674674
valid Pylock instances (i.e. one obtained from :meth:`Pylock.from_dict`
675675
or if constructed manually, after calling :meth:`Pylock.validate`).
676676
"""
677-
if tags is None:
678-
tags = list(sys_tags())
677+
supported_tags = frozenset(tags or sys_tags())
679678

680679
# #. Gather the extras and dependency groups to install and set ``extras`` and
681680
# ``dependency_groups`` for marker evaluation, respectively.
@@ -790,7 +789,7 @@ def select(
790789
for package_wheel in package.wheels:
791790
assert package_wheel.name # XXX get name from path or url
792791
package_wheel_tags = parse_wheel_filename(package_wheel.name)[-1]
793-
if not package_wheel_tags.isdisjoint(tags):
792+
if not package_wheel_tags.isdisjoint(supported_tags):
794793
yield package, package_wheel
795794
break
796795
else:

0 commit comments

Comments
 (0)