Skip to content

Commit 8919d00

Browse files
committed
Fix license verification in wheels.
1 parent ed514e4 commit 8919d00

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ci/check_wheel_licenses.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@
2121
dist_dir = project_dir / 'dist'
2222
license_dir = project_dir / 'LICENSE'
2323

24-
license_file_names = [path.name for path in sorted(license_dir.glob('*'))]
24+
license_file_names = {path.name for path in sorted(license_dir.glob('*'))}
2525
for wheel in dist_dir.glob('*.whl'):
2626
print(f'Checking LICENSE files in: {wheel}')
2727
with zipfile.ZipFile(wheel) as f:
28-
wheel_license_file_names = [Path(path).name
28+
wheel_license_file_names = {Path(path).name
2929
for path in sorted(f.namelist())
30-
if '.dist-info/LICENSE' in path]
31-
if wheel_license_file_names != license_file_names:
30+
if '.dist-info/LICENSE' in path}
31+
if not (len(wheel_license_file_names) and
32+
wheel_license_file_names.issuperset(license_file_names)):
3233
print(f'LICENSE file(s) missing:\n'
3334
f'{wheel_license_file_names} !=\n'
3435
f'{license_file_names}')

0 commit comments

Comments
 (0)