BLD: create a LICENSE_BUNDLED.txt file from third_party licenses#50745
BLD: create a LICENSE_BUNDLED.txt file from third_party licenses#50745mattip wants to merge 3 commits intopytorch:masterfrom
Conversation
|
Here is the file the new command creates Edit: link to latest version of the file |
|
There are a few quirks in the file. There are some third_party projects PyTorch included multiple times (benchmark has 4 copies, clog has 3, googletest has 10, there are more), I included each one separately since they are not all on the same version. Most of the licenses are copies of the original BSD/MIT/Boost/Apache, except:
|
|
@rgommers do you have an idea how/where to merge the LICENSE files when generating a wheel? I guess I could expand the |
Codecov Report
@@ Coverage Diff @@
## master #50745 +/- ##
==========================================
- Coverage 80.65% 80.65% -0.01%
==========================================
Files 1912 1912
Lines 208048 208048
==========================================
- Hits 167810 167808 -2
- Misses 40238 40240 +2 |
walterddr
left a comment
There was a problem hiding this comment.
do we need to modify the NOTICE file too since it also contains paragraphs discussing thrid-party license
Each snippet taken from somewhere else and merged into the pytorch sources (not the third party directory) should be attributed in the source. I think another file should be used to maintain the required attributions for such code. Is that the NOTICE file? The point of the current PR is to add attributions for third party libraries in the third_parties directory which are maintained separately from pytorch itself. If things are missing from NOTICES maybe it can be fixed in a different PR? |
|
Rebased and squashed. Ready for review, assuming CI passes. |
facebook-github-bot
left a comment
There was a problem hiding this comment.
@walterddr has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
There was a problem hiding this comment.
I dont know if we have a guidance but was wondering if we should put this in tools/ or scripts/ instead of third_party/. CC @seemethere @malfet
There was a problem hiding this comment.
No preference, but it would be good to have a shebang at the head of the file
There was a problem hiding this comment.
No preference, but it would be good to have a shebang at the head of the file
Co-authored-by: Nikita Shulga <nikita.shulga@gmail.com>
|
@walterddr merged this pull request in 24eab1d. |
This script was hanging up on a couple of licenses not being parsed correctly / not accounted for in the [original pass through](#50745) Should resolve issues with tests not running 100% correctly. (originally reported in #76128) Also adds an option to run the script and specify a different output file: * CLI Argument `--out-file` * Environment Variable: `PYTORCH_THIRD_PARTY_BUNDLED_LICENSE_FILE` Signed-off-by: Eli Uriegas <eliuriegasfb.com> [ghstack-poisoned]
…orch#50745) Summary: Fixes pytorch#50695. Rather than maintain a LICENSE_BUNDLED.txt by hand, this build it out of the subrepos. I ~copied and adapted the sdist handling from Numpy~ added a separate file, so the LICENSE.txt file of the repo remains in pristine condition and the GitHub website still recognizes it. If we modify the file, the website will no longer recognize the license. This is not enough, since the license in the ~wheel~ wheel and sdist is not modified. Numpy has a [separate step](https://github.com/MacPython/numpy-wheels/blob/master/patch_code.sh) when preparing the wheel to concatenate the licenses. I am not sure where/if the [conda-forge numpy-feedstock](https://github.com/conda-forge/numpy-feedstock/) also fixes up the license. ~Should~ I ~commit~ commited the artifact to the repo and ~add~ added a test that reproducing the file is consistent. Edit: now the file is part of the repo. Edit: rework the mention of sdist. After this is merged another PR is needed to make the sdist and wheel ship the proper merged license. Pull Request resolved: pytorch#50745 Reviewed By: seemethere, heitorschueroff Differential Revision: D26074974 Pulled By: walterddr fbshipit-source-id: bacd5d6870e9dbb419a31a3e3d2fdde286ff2c94
Fixes #50695.
Rather than maintain a LICENSE_BUNDLED.txt by hand, this build it out of the subrepos.
I
copied and adapted the sdist handling from Numpyadded a separate file, so the LICENSE.txt file of the repo remains in pristine condition and the GitHub website still recognizes it. If we modify the file, the website will no longer recognize the license.This is not enough, since the license in the
wheelwheel and sdist is not modified. Numpy has a separate step when preparing the wheel to concatenate the licenses. I am not sure where/if the conda-forge numpy-feedstock also fixes up the license.ShouldIcommitcommited the artifact to the repo andaddadded a test that reproducing the file is consistent.Edit: now the file is part of the repo.
Edit: rework the mention of sdist. After this is merged another PR is needed to make the sdist and wheel ship the proper merged license.