Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to "alternate license files" (e.g. LICENSE.BSD, LICENSE.APACHE) --with-license-file #194

Open
joao-dgg opened this issue Jun 19, 2024 · 2 comments

Comments

@joao-dgg
Copy link

The packaging module has multiple licenses, Apache and BSD. When using the --with-license-file with the module in question, the result is as follow:

packaging
24.0
Apache Software License; BSD License
This software is made available under the terms of either of the licenses
found in LICENSE.APACHE or LICENSE.BSD. Contributions to this software is made
under the terms of both these licenses.

Checking the .whl of said package, there are three license files in total: LICENSE (which is the text quoted above), LICENSE.BSD and LICENSE.APACHE.

I assume pip-licenses currently does not support said 'alternate' or additional files? Or is there a flag I might have missed?

Apologies on ahead if the title is unclear, but I wasn't sure how else to name it.

@joao-dgg
Copy link
Author

Checking the changelog, I see that a specific file is chosen, or at least this used to be the case. Would there be any way to go with "all" LICENSE* files?
image

@stefan6419846
Copy link

This has been proposed in #78 already, but closed for now. The reason is that

pip-licenses/piplicenses.py

Lines 209 to 218 in 6176cc5

for rel_path in matched_rel_paths:
abs_path = Path(pkg.locate_file(rel_path))
if not abs_path.is_file():
continue
included_file = str(abs_path)
with open(
abs_path, encoding="utf-8", errors="backslashreplace"
) as included_file_handle:
included_text = included_file_handle.read()
break
breaks on the first file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants