Skip to content

Commit 2437e37

Browse files
committed
fix: Fixed bad requirements comparision for the exclude list
1 parent cb6ea25 commit 2437e37

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

build_wheels.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@ def exclude_from_requirements(assembled_requirements: set, exclude_list: set, pr
212212
"""Exclude packages defined in exclude_list from assembled requirements
213213
- print_requirements = true will print the changes
214214
"""
215+
from packaging.utils import canonicalize_name
216+
215217
new_assembled_requirements = set()
216218
not_in_exclude = []
217219
if print_requirements:
@@ -220,7 +222,8 @@ def exclude_from_requirements(assembled_requirements: set, exclude_list: set, pr
220222
for requirement in assembled_requirements:
221223
printed = False
222224
for req_to_exclude in exclude_list:
223-
if req_to_exclude.name not in requirement.name:
225+
# Use canonical name comparison to handle dots vs underscores (ruamel.yaml.clib vs ruamel_yaml_clib)
226+
if canonicalize_name(req_to_exclude.name) != canonicalize_name(requirement.name):
224227
not_in_exclude.append(True)
225228
else:
226229
if not req_to_exclude.specifier and not req_to_exclude.marker:

0 commit comments

Comments
 (0)