From fb9e89298201a43a3b3656fdf1f2f3cb57a8fcf2 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Sun, 17 Nov 2024 12:30:08 -0500 Subject: [PATCH] docs: fix packaging.licenses suggestion (#215) * docs: fix packaging.licenses suggestion * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4d9f485..7f6c076 100644 --- a/README.md +++ b/README.md @@ -38,11 +38,13 @@ print(str(pkg_info)) # core metadata If `project.license` is a string or `project.license-files` is present, then METADATA 2.4+ will be used. A user is expected to validate and normalize `metadata.license` with an SPDX validation tool, such as the one being added to -`packaging`. Add something like this: +`packaging`. Add something like this (requires packaging 24.2+): ```python if isinstance(metadata.license, str): - metadata.license = packaging.licenses.normalize_license_expression(metadata.license) + metadata.license = packaging.licenses.canonicalize_license_expression( + metadata.license + ) ``` A backend is also expected to copy entries from `project.licence_files`, which