-
Notifications
You must be signed in to change notification settings - Fork 38
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 in setup() #41
Comments
We ran into a related issue in pypi/warehouse#3225. |
I haven’t seen a whole license file in the license keyword, and haven’t seen anything documenting or recommending that. The classifier has a list of valid values and is documented (in PEPs at least) as the recommended option. The license field is documented as optional and free form. It is redundant with a classifier but not exclusive (i.e. does not make the metadata invalid or cause tools to error out). |
But, it's possible, which means users have done it (There's packages on PyPI for which this is true).
I think the metadata specification describes this best:
|
Curiously, this is actually a good idea in some sense... because most OSS licenses require that you include the text of the license when you redistribute. (E.g. MIT says: "Permission is hereby granted [to do anything you want with this code] subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.", emphasis mine.) Currently there's no mechanism for including license files in wheels, so I think those weird packages that got confused about the The current approaches to handling license metadata are also pretty limited – for example, there's no way to express licenses like pyca/cryptography's dual MIT/Apache2. It made sense at the time, but is probably overdue for an overhaul. A further wrinkle is that when tools like So at some point I think we should:
|
Just chiming in quick: I am involved in SPDX quite a bit and I maintain a decent Python-based license scanner (scancode-toolkit). I started extremely slowly working on a draft of a draft of a PEP idea related to this in pombredanne/spdx-pypi-pep#1 about a year ago... @njsmith re
Actually there is a little known way to include one single license file in a wheel using setup.cfg
This would include a NOTICE file from the root in your wheel See for example: https://github.com/nexB/scancode-toolkit/blob/fd2e483e346a38ee9634538a0f05ca4dd96fb622/setup.cfg#L2 |
pypa/packaging-problems#41 Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
There's a related issue that might be good to tackle here: ensuring that packages can actually be distributed according to the specified licence. Perhaps we need a checkbox on PyPI that says the I am not a lawyer (and I probably should consult one before downloading something from PyPI). |
@encukou my 2 cents: you may be over worried here IMHO. Beside the metadata, there is nothing that would prevent a bad actor to act badly wrt. licensing in some ways other ways, so I am not sure that an extra checkbox would bring something of value. |
@pombredanne We actually have wording in the PyPI ToS that serves to protect both the PSF and mirror operators when it comes to duplication and distribution of the uploaded packages. However, the Terms of Service don't cover actually executing any of the code in the uploaded artifacts, not even the build scripts - that's all handled via the open source licenses that are applied to projects. So I think it would be well worth asking @VanL (as the PSF's general counsel and an experienced open source IP lawyer) whether there's a potential opportunity here along the lines of what @encukou mentions. |
@ncoghlan Thank you for taking the time to chime in! and this make sense (FWIW I met @VanL at the last FOSDEM/CopyleftConf and he mentioned even using some of my tools: yummy) ... @VanL what's your take here? Specifically on this item: #41 (comment)
|
@pombredanne I've used scancode-toolkit as well - it just didn't click why your name was familiar until you mentioned it. Thank you for that project! |
@ncoghlan thank you for using scancode-toolkit 🙇♂️ ... if there is anything that is not detected right, it's a bug so send it my way and you will get prime expedited delivery treatment :) |
Yes, PSF has very nice wording, but just for PyPI. |
@encukou you wrote:
This would be what linux distros do too, and the main ones such as Debian and Fedora do typically review and vet the license of the packages they build/package/distribute. |
FTR -- there's discussion happening related to this at https://discuss.python.org/t/improving-license-clarity-with-better-package-metadata/2154/. |
pypa/packaging-problems#41 Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
pypa/packaging-problems#41 Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
* Add PEP draft for SPDX license expressions Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Add reference to another license-related ticket pypa/packaging-problems#41 Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Add proper Draft status Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Direct PEP discussions to discuss.python.org Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Adopt latest PEP copyright conventions Reported-by: Aliaksei Urbanski @Jamim Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Add @pf_moore as BDFL delegate. And fix minor typo Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Add Paul Moore as a PEP sponsor CC: @pfmoore Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Reuse License Field. Add License-File. Do not deprecate the License field with a new field. Instead reuse License and provide backward compatibility. Also add License-File field already in use in wheel and setuptools. Integrates latest feedback Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Add packaging license metadata survey sections Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Add poetry and flit references CC: @takluyver and @sdispater Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Fix typo Reported-by: Pradyun Gedam @pradyunsg Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> Co-Authored-By: Pradyun Gedam <pradyunsg@gmail.com> * Fix typo and improve subtitle Reported-by: Pradyun Gedam <pradyunsg@gmail.com> Co-Authored-By: Pradyun Gedam <pradyunsg@gmail.com> Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Fix typo Reported-by: Pradyun Gedam <pradyunsg@gmail.com> Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> Co-Authored-By: Pradyun Gedam <pradyunsg@gmail.com> * Fix typo Reported-by: Pradyun Gedam <pradyunsg@gmail.com> Co-Authored-By: Pradyun Gedam <pradyunsg@gmail.com> Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Use appendix and use footnotes for links Also improve formatting Reported-by: Pradyun Gedam @pradyunsg Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Add new sections and improve existing sections - Refactor intro with new and improved abstract, scope, non-scope, motivation and rationale sections - Add new Backwards Compatibility, Security and How to Teach sections - Move Reference Implementation out of appendix as its own section - Add new Rejected ideas section - Add new License Expression example using setuptools in Appendix Reported-by: Chris Jerdonek @cjerdonek Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Fix typo Reported-By: Pradyun Gedam <pradyunsg@gmail.com> Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> Co-Authored-By: Pradyun Gedam <pradyunsg@gmail.com> * Fix typo Reported-By: Pradyun Gedam <pradyunsg@gmail.com> Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> Co-Authored-By: Pradyun Gedam <pradyunsg@gmail.com> * Improve presentation Reported-By: Pradyun Gedam <pradyunsg@gmail.com> Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> Co-Authored-By: Pradyun Gedam <pradyunsg@gmail.com> * Improve style Reported-By: Pradyun Gedam <pradyunsg@gmail.com> Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> Co-Authored-By: Pradyun Gedam <pradyunsg@gmail.com> * Move setuptools and wheel notes on license-file out Reported-by: Nick Coghlan @ncoghlan Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Clarify and discourage use of public domain Reported-by: Nick Coghlan @ncoghlan Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Fix typo Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Fix typos and clarify multi classifiers migrations Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Report warning for expression case The case does nt matter, but there is a canonical case: if the case is the not the standard canonical case, tools should issue a warning. Reported-by: Oleg Grenrus @phadej Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Use deprecated not obsolete per SPDX Reported-by: Oleg Grenrus @phadej Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Correct Cabal that uses SPDX expressions Cabal uses both expressions and license files as proposed in this PEP Reported-by: Oleg Grenrus @phadej Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Fix typo Reported-by: Oleg Grenrus @phadej Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Use LicenseRef- prefix for non-standard SPDX ids This help endsure that the expressions is fully parseable by a conforming license expression processor Reported-by: Oleg Grenrus @phadej Reported-by: Nick Coghlan @ncoghlan Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Fix typos. Reporte-by: Cyril Roelandt <tipecaml@gmail.com> Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Fix typo and add BSD* distributions reference Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Fix typo and improve grammar Reported-by: Nick Coghlan @ncoghlan Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Copy Edits for initial sections * Reword a paragraph * Update pep-9999.rst * Fix typo Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Remove erroneous leading spaces Reported-by: Pradyun Gedam @pradyunsg Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com> * Update SPDX license list and spec versions Use latest SPDX spec 2.2 and SPDX license list 3.10 Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Fix typos and formatting Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Clarify License file path definition Reported-by: Miro Hrončok @hroncok Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Use permalink for discussion link Reported-by: Tzu-ping Chung @uranusjr Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Assign number as PEP-0639 Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
…n#1625) * Add PEP draft for SPDX license expressions Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Add reference to another license-related ticket pypa/packaging-problems#41 Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Add proper Draft status Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Direct PEP discussions to discuss.python.org Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Adopt latest PEP copyright conventions Reported-by: Aliaksei Urbanski @Jamim Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Add @pf_moore as BDFL delegate. And fix minor typo Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Add Paul Moore as a PEP sponsor CC: @pfmoore Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Reuse License Field. Add License-File. Do not deprecate the License field with a new field. Instead reuse License and provide backward compatibility. Also add License-File field already in use in wheel and setuptools. Integrates latest feedback Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Add packaging license metadata survey sections Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Add poetry and flit references CC: @takluyver and @sdispater Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Fix typo Reported-by: Pradyun Gedam @pradyunsg Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> Co-Authored-By: Pradyun Gedam <pradyunsg@gmail.com> * Fix typo and improve subtitle Reported-by: Pradyun Gedam <pradyunsg@gmail.com> Co-Authored-By: Pradyun Gedam <pradyunsg@gmail.com> Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Fix typo Reported-by: Pradyun Gedam <pradyunsg@gmail.com> Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> Co-Authored-By: Pradyun Gedam <pradyunsg@gmail.com> * Fix typo Reported-by: Pradyun Gedam <pradyunsg@gmail.com> Co-Authored-By: Pradyun Gedam <pradyunsg@gmail.com> Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Use appendix and use footnotes for links Also improve formatting Reported-by: Pradyun Gedam @pradyunsg Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Add new sections and improve existing sections - Refactor intro with new and improved abstract, scope, non-scope, motivation and rationale sections - Add new Backwards Compatibility, Security and How to Teach sections - Move Reference Implementation out of appendix as its own section - Add new Rejected ideas section - Add new License Expression example using setuptools in Appendix Reported-by: Chris Jerdonek @cjerdonek Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Fix typo Reported-By: Pradyun Gedam <pradyunsg@gmail.com> Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> Co-Authored-By: Pradyun Gedam <pradyunsg@gmail.com> * Fix typo Reported-By: Pradyun Gedam <pradyunsg@gmail.com> Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> Co-Authored-By: Pradyun Gedam <pradyunsg@gmail.com> * Improve presentation Reported-By: Pradyun Gedam <pradyunsg@gmail.com> Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> Co-Authored-By: Pradyun Gedam <pradyunsg@gmail.com> * Improve style Reported-By: Pradyun Gedam <pradyunsg@gmail.com> Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> Co-Authored-By: Pradyun Gedam <pradyunsg@gmail.com> * Move setuptools and wheel notes on license-file out Reported-by: Nick Coghlan @ncoghlan Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Clarify and discourage use of public domain Reported-by: Nick Coghlan @ncoghlan Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Fix typo Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Fix typos and clarify multi classifiers migrations Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Report warning for expression case The case does nt matter, but there is a canonical case: if the case is the not the standard canonical case, tools should issue a warning. Reported-by: Oleg Grenrus @phadej Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Use deprecated not obsolete per SPDX Reported-by: Oleg Grenrus @phadej Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Correct Cabal that uses SPDX expressions Cabal uses both expressions and license files as proposed in this PEP Reported-by: Oleg Grenrus @phadej Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Fix typo Reported-by: Oleg Grenrus @phadej Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Use LicenseRef- prefix for non-standard SPDX ids This help endsure that the expressions is fully parseable by a conforming license expression processor Reported-by: Oleg Grenrus @phadej Reported-by: Nick Coghlan @ncoghlan Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Fix typos. Reporte-by: Cyril Roelandt <tipecaml@gmail.com> Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Fix typo and add BSD* distributions reference Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Fix typo and improve grammar Reported-by: Nick Coghlan @ncoghlan Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Copy Edits for initial sections * Reword a paragraph * Update pep-9999.rst * Fix typo Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Remove erroneous leading spaces Reported-by: Pradyun Gedam @pradyunsg Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com> * Update SPDX license list and spec versions Use latest SPDX spec 2.2 and SPDX license list 3.10 Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Fix typos and formatting Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Clarify License file path definition Reported-by: Miro Hrončok @hroncok Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Use permalink for discussion link Reported-by: Tzu-ping Chung @uranusjr Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Assign number as PEP-0639 Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
There's quite a few way to add a license:
setup(license=)
setup(license=)
What method should be used and are any of them mutually exclusive. For example, if you have a license classifier, do you still need the
license
key?The text was updated successfully, but these errors were encountered: