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

LICENSE file in the wheel package references files that are not included in the wheel #81181

Closed
mattip opened this issue Jul 10, 2022 · 5 comments
Labels
module: binaries Anything related to official binaries that we release to users

Comments

@mattip
Copy link
Collaborator

mattip commented Jul 10, 2022

🐛 Describe the bug

PR #50745 automatically creates a third_party/LICENSES_BUNDLED.txt which has text like

The Pytorch repository and source distributions bundle several libraries that are 
compatibly licensed.  We list these here.

Name: FP16
License: MIT
Files: third_party/FP16
  For details, see third_party/FP16/LICENSE

Name: FP16-source
License: MIT
Files: third_party/XNNPACK/build/FP16-source
  For details, see third_party/XNNPACK/build/FP16-source/LICENSE

but the third_party directory is not included in the wheel/sdist so the license text is incomplete. This came up in conda-forge/pytorch-cpu-feedstock#121. There should be some file with all the LICENSEs involved.

xref @rgommers

Versions

HEAD and any release since PR #50745

cc @ezyang @seemethere @malfet

@mattip
Copy link
Collaborator Author

mattip commented Jul 10, 2022

Possible solutions could be

  • include all the LICENSE files in the wheel/sdist, either by adding them directly to the third_party/LICENSES_BUNDLED.txt or as separate files
  • have links to the project licenses

@rgommers
Copy link
Collaborator

rgommers commented Jul 11, 2022

Probably including all individual files in the .dist-info directory is the way to go, since it's most readable and it is what PEP 639 is going to make the standard soon. setuptools already does this by default, with the license_files keyword to setup() (see docs). We're just not using that in PyTorch yet.

I believe LICENSES_bundled.txt is still very useful as an overview of all included code with different licenses.

Maybe try to add license_files in setup.py and see if it does the right thing out of the box?

@albanD albanD added the module: binaries Anything related to official binaries that we release to users label Jul 12, 2022
@mattip
Copy link
Collaborator Author

mattip commented Jul 14, 2022

Adding license_files to the setup() call in setup.py fails because of pypa/setuptools#2739. It turns out setuptools finds the files, but wheel requires an additional configuration option to add them. Even then, the files cannot be in a heirarchy, as mentioned in the wheel documentation. If it is desirable to keep the files separate, we could rename them as third_party_XNNPACK_build_FP16-source_LICENSE and then add all the names to the wheel via a setup.cfg file.

In light of the complications, perhaps it would be better to concatenate all the licenses into the LICENSE_bundled.txt after the current summary, as

Summary
-------
<current LICENSE_bundled.txt contents>

third_party/FP16/LICENSE
------------------------
<file contents>

third_party/XNNPACK/build/FP16-source/LICENSE
---------------------------------------------
<file contents>

@rgommers
Copy link
Collaborator

Always more bugs to run into:(

In light of the complications, perhaps it would be better to concatenate all the licenses into the LICENSE_bundled.txt after the current summary,

I agree

@mattip
Copy link
Collaborator Author

mattip commented Jul 14, 2022

hmm. The test in test/test_license.py to make sure the third_party/LICENCES_BUNDLED.txt is up to date is failing...

facebook-github-bot pushed a commit that referenced this issue Jul 19, 2022
Summary:
Fixes #81181 by creating a temporary LICENCE file that has all the third-party licenses concatenated together when creating a wheel. Also update the `third_party/LICENSES_BUNDLED.txt` file.

The `third_party/LICENSES_BUNDLED.txt` file is supposed to be tested via `tests/test_license.py`, but the test is not running?

Pull Request resolved: #81500
Approved by: https://github.com/rgommers, https://github.com/seemethere

Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/37474a54de48818c07d014fc62595e501c6c7bd3

Reviewed By: jeanschmidt

Differential Revision: D37951764

Pulled By: jeanschmidt

fbshipit-source-id: 5abbcd91a498d65df0513f03712d86fd255d3107
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: binaries Anything related to official binaries that we release to users
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants