Skip to content

Commit

Permalink
fix: include license file entry in search (#601)
Browse files Browse the repository at this point in the history
This would help
#571 not have
shown an error (but in that case, multiple licenses is actually desired,
and the custom `tool.scikit-build` setting should be used until PEP 639
goes somewhere).

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
henryiii and pre-commit-ci[bot] committed Jan 3, 2024
1 parent 0179b9d commit 35821bf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/scikit_build_core/build/wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,16 @@ def _build_wheel_impl(
else:
install_dir = wheel_dirs[targetlib] / settings.wheel.install_dir

# Include the metadata license.file entry if provided
license_file_globs = list(settings.wheel.license_files)
if metadata.license and metadata.license.file:
license_file_globs.append(str(metadata.license.file))

license_files = {
x: x.read_bytes()
for y in settings.wheel.license_files
for y in license_file_globs
for x in Path().glob(y)
if x.is_file()
}
if settings.wheel.license_files and not license_files:
logger.warning(
Expand Down

0 comments on commit 35821bf

Please sign in to comment.