-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 for license_files
option in metadata
#1767
Conversation
Would it be possible to get a review? |
@jakirkham I cant put proper review comments as I'm not on the setuptools team, but it looks like @kchmck has a pretty good PR here. 👍 Edit: I'd like to second the call for a review, since I'm eager to use this in packages/places that are reliant on setuptools' behaviour. It would be especially useful to have this reviewed in light of current discussions about package license metadata, https://discuss.python.org/t/improving-license-clarity-with-better-package-metadata/2154 |
- Added support for specifying a set of license files as part of the project config. - Moved the license file config into the package configuration. (`Poetry.create()`) this matches how similar configurations such as “readme” are configured. - Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files. - Moved the existing auto-discovery behaviours to become the default case during `create()` if nothing specific was configured. - Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`.
- Added support for specifying a set of license files as part of the project config. - Moved the license file config into the package configuration. (`Poetry.create()`) this matches how similar configurations such as “readme” are configured. - Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files. - Moved the existing auto-discovery behaviours to become the default case during `create()` if nothing specific was configured. - Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
- Added support for specifying a set of license files as part of the project config. - Moved the license file config into the package configuration. (`Poetry.create()`) this matches how similar configurations such as “readme” are configured. - Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files. - Moved the existing auto-discovery behaviours to become the default case during `create()` if nothing specific was configured. - Added tests for the new features - Added the “license-files” field to the poetry-schema.json - Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
- Added support for specifying a set of license files as part of the project config. - Moved the license file config into the package configuration. (`Poetry.create()`) this matches how similar configurations such as “readme” are configured. - Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files. - Moved the existing auto-discovery behaviours to become the default case during `create()` if nothing specific was configured. - Added tests for the new features - Documented the new configuration field. - Added the “license-files” field to the poetry-schema.json - Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
- Added support for specifying a set of license files as part of the project config. - Moved the license file config into the package configuration. (`Poetry.create()`) this matches how similar configurations such as “readme” are configured. - Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files. - Moved the existing auto-discovery behaviours to become the default case during `create()` if nothing specific was configured. - Added tests for the new features - Documented the new configuration field. - Added the “license-files” field to the poetry-schema.json - Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
- Added support for specifying a set of license files as part of the project config. - Moved the license file config into the package configuration. (`Poetry.create()`) this matches how similar configurations such as “readme” are configured. - Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files. - Moved the existing auto-discovery behaviours to become the default case during `create()` if nothing specific was configured. - Added tests for the new features - Documented the new configuration field. - Added the “license-files” field to the poetry-schema.json - Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
- Added support for specifying a set of license files as part of the project config. - Moved the license file config into the package configuration. (`Poetry.create()`) this matches how similar configurations such as “readme” are configured. - Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files. - Moved the existing auto-discovery behaviours to become the default case during `create()` if nothing specific was configured. - Added tests for the new features - Documented the new configuration field. - Added the “license-files” field to the poetry-schema.json - Updated pre-commit config to use the correct black source repo. - Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
- Fixes python-poetry#1350 - Added support for specifying a set of license files as part of the project config. - Moved the license file config into the package configuration. (`Poetry.create()`) this matches how similar configurations such as “readme” are configured. - Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files. - Moved the existing auto-discovery behaviours to become the default case during `create()` if nothing specific was configured. - Added tests for the new features - Documented the new configuration field. - Added the “license-files” field to the poetry-schema.json - Updated pre-commit config to use the correct black source repo. - Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
- Fixes python-poetry#1350 - Added support for specifying a set of license files as part of the project config. - Moved the license file config into the package configuration. (`Poetry.create()`) this matches how similar configurations such as “readme” are configured. - Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files. - Moved the existing auto-discovery behaviours to become the default case during `create()` if nothing specific was configured. - Added tests for the new features - Documented the new configuration field. - Added the “license-files” field to the poetry-schema.json - Updated pre-commit config to use the correct black source repo. - Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
- Fixes python-poetry#1350 - Added support for specifying a set of license files as part of the project config. - Moved the license file config into the package configuration. (`Poetry.create()`) this matches how similar configurations such as “readme” are configured. - Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files. - Moved the existing auto-discovery behaviours to become the default case during `create()` if nothing specific was configured. - Added tests for the new features - Documented the new configuration field. - Added the “license-files” field to the poetry-schema.json - Updated pre-commit config to use the correct black source repo. - Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
- Fixes python-poetry#1350 - Added support for specifying a set of license files as part of the project config. - Moved the license file config into the package configuration. (`Poetry.create()`) this matches how similar configurations such as “readme” are configured. - Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files. - Moved the existing auto-discovery behaviours to become the default case during `create()` if nothing specific was configured. - Added tests for the new features - Documented the new configuration field. - Added the “license-files” field to the poetry-schema.json - Updated pre-commit config to use the correct black source repo. - Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
- Fixes python-poetry#1350 - Added support for specifying a set of license files as part of the project config. - Moved the license file config into the package configuration. (`Poetry.create()`) this matches how similar configurations such as “readme” are configured. - Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files. - Moved the existing auto-discovery behaviours to become the default case during `create()` if nothing specific was configured. - Added tests for the new features - Documented the new configuration field. - Added the “license-files” field to the poetry-schema.json - Updated pre-commit config to use the correct black source repo. - Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
- Fixes python-poetry#1350 - Added support for specifying a set of license files as part of the project config. - Moved the license file config into the package configuration. (`Poetry.create()`) this matches how similar configurations such as “readme” are configured. - Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files. - Moved the existing auto-discovery behaviours to become the default case during `create()` if nothing specific was configured. - Added tests for the new features - Documented the new configuration field. - Added the “license-files” field to the poetry-schema.json - Updated pre-commit config to use the correct black source repo. - Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
- Fixes python-poetry#1350 - Added support for specifying a set of license files as part of the project config. - Moved the license file config into the package configuration. (`Factory.create_poetry()`) this matches how similar configurations such as “readme” are configured. - Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files. - Moved the existing auto-discovery behaviours to become the default case during `create_poetry()` if nothing specific was configured. - Added tests for the new features - Documented the new configuration field. - Added the “license-files” field to the poetry-schema.json - Updated pre-commit config to use the correct black source repo, and set the default language for better consistency with any other pre-commit checks that will be added in the future. - Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
- Fixes python-poetry#1350 - Added support for specifying a set of license files as part of the project config. - Moved the license file config into the package configuration. (`Factory.create_poetry()`) this matches how similar configurations such as “readme” are configured. - Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files. - Moved the existing auto-discovery behaviours to become the default case during `create_poetry()` if nothing specific was configured. - Added tests for the new features - Documented the new configuration field. - Added the “license-files” field to the poetry-schema.json - Updated pre-commit config to use the correct black source repo, and set the default language for better consistency with any other pre-commit checks that will be added in the future. - Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
An important reference to this effort is this thread, where many in the PyPA settle on supporting license files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This generally looks good. Just a few small issues and this can be accepted.
Looks like this is ready for another review! 😄 |
Thanks all for getting this in! This is a really great feature 😄 |
- Fixes python-poetry#1350 - Added support for specifying a set of license files as part of the project config. - Moved the license file config into the package configuration. (`Factory.create_poetry()`) this matches how similar configurations such as “readme” are configured. - Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files. - Moved the existing auto-discovery behaviours to become the default case during `create_poetry()` if nothing specific was configured. - Added tests for the new features - Documented the new configuration field. - Added the “license-files” field to the poetry-schema.json - Updated pre-commit config to use the correct black source repo, and set the default language for better consistency with any other pre-commit checks that will be added in the future. - Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
- Fixes python-poetry#1350 - Added support for specifying a set of license files as part of the project config. - Moved the license file config into the package configuration. (`Factory.create_poetry()`) this matches how similar configurations such as “readme” are configured. - Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files. - Moved the existing auto-discovery behaviours to become the default case during `create_poetry()` if nothing specific was configured. - Added tests for the new features - Documented the new configuration field. - Added the “license-files” field to the poetry-schema.json - Updated pre-commit config to use the correct black source repo, and set the default language for better consistency with any other pre-commit checks that will be added in the future. - Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
- Fixes python-poetry#1350 - Added support for specifying a set of license files as part of the project config. - Moved the license file config into the package configuration. (`Factory.create_poetry()`) this matches how similar configurations such as “readme” are configured. - Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files. - Moved the existing auto-discovery behaviours to become the default case during `create_poetry()` if nothing specific was configured. - Added tests for the new features - Documented the new configuration field. - Added the “license-files” field to the poetry-schema.json - Updated pre-commit config to use the correct black source repo, and set the default language for better consistency with any other pre-commit checks that will be added in the future. - Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
- Fixes python-poetry#1350 - Added support for specifying a set of license files as part of the project config. - Moved the license file config into the package configuration. (`Factory.create_poetry()`) this matches how similar configurations such as “readme” are configured. - Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files. - Moved the existing auto-discovery behaviours to become the default case during `create_poetry()` if nothing specific was configured. - Added tests for the new features - Documented the new configuration field. - Added the “license-files” field to the poetry-schema.json - Updated pre-commit config to use the correct black source repo, and set the default language for better consistency with any other pre-commit checks that will be added in the future. - Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
Summary of changes
Support for
license_file
was added tobdist_wheel
in pypa/wheel#47 / pypa/wheel@0acfb4c and then to setuptools in #1536. Last year, wheel also added support for alicense_files
option in pypa/wheel#138 / pypa/wheel@59976ab to enable including more than one license. At the same time,license_file
was deprecated in that project, and using it leads to aDeprecationWarning
if warnings are enabled. The docs for wheel also mention thatlicense_files
is the favored option.Currently, setuptools only supports
license_file
, which leads to theDeprecationWarning
code path if wheel is also used when building distributions.This PR adds the
license_files
functionality to setuptools, which enables the more versatile form to work across both tools and allows users to take advantage of the functionality without hitting deprecated code.A few notes about the implementation:
If
license_file
is specified, the file is also added to the set (same behavior as wheel), which preserves backwards compatibility. I wasn't sure if any sort of deprecation was appropriate here, so I left that part outI added
license_files
toDistribution
andConfigMetadataHandler
because it seemed to be the best way to reuse the list option parser, but please advise if it should be done a different wayLeaving the option empty in wheel disables license auto-including, which AFAICT matches the default behavior of setuptools if either option is empty (and MANIFEST.in doesn't include them)
Pull Request Checklist