Skip to content

Commit

Permalink
docs: fix packaging.licenses suggestion (#215)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
henryiii and pre-commit-ci[bot] authored Nov 17, 2024
1 parent a8656f1 commit fb9e892
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fb9e892

Please sign in to comment.