Skip to content

Commit 3e57a98

Browse files
committed
Rewording description of license metadata
- aim to be clear that pyproject.toml license entry is a "short code" or reference to the choice of license - add note on and link to SPDX expressions for precision - add sentence on license-files key for completeness
1 parent 363d570 commit 3e57a98

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

tutorials/add-license-coc.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ In this lesson you will learn:
2626
A license contains legal language about how users can use and reuse your software. To set the `LICENSE` for your project, you:
2727

2828
1. Create a `LICENSE` file in your project directory that specifies the license that you choose for your package.
29-
2. Reference that license in your `pyproject.toml` data where metadata are set.
29+
2. Describe your choice of license in your `pyproject.toml` data where metadata are set.
3030

31-
By adding the license reference to your `pyproject.toml` file, the license will be included in your package's metadata which is used to populate your package's PyPI landing page. The `LICENSE` is also used in your GitHub repository's landing page interface.
31+
By adding this metadata to your `pyproject.toml` file, the choice of license will be included in your package's metadata which is used to populate your package's PyPI landing page. The `LICENSE` file is also used in your GitHub repository's landing page interface.
3232

3333
### What license should you use?
3434

tutorials/pyproject-toml.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,11 +272,9 @@ you want to have listed as authors and maintainers on your PyPI landing page.
272272
### Step 2: Add README and license
273273

274274
In the previous lessons, you added both a [README.md](add-readme) file and a [LICENSE](add-license-coc) to your package repository.
275-
Once you have those files, you can refer to the README from your pyproject.toml file, and add a short reference to your LICENSE
275+
Once you have those files, you can refer to the README from your pyproject.toml file, and add a short code indicating your choice of LICENSE
276276
following the example below.
277277

278-
The reference to your license should use the [license expression syntax](https://packaging.python.org/en/latest/specifications/license-expression/), which can generally be a short name (with no spaces) for the license, such as "MIT", "BSD-3-Clause" or "Apache-2.0".
279-
280278
{emphasize-lines="20-21"}
281279
```toml
282280
[build-system]
@@ -301,6 +299,13 @@ maintainers = [
301299
readme = "README.md"
302300
license = "MIT"
303301
```
302+
303+
The license entry in your pyproject.toml file must use the [license expression syntax](https://packaging.python.org/en/latest/specifications/license-expression/). Often this is a short name (with no spaces) for the license, such as "MIT", "BSD-3-Clause" or "Apache-2.0". More precisely, it must be a valid SPDX license expression, as documented in the [SPDX specification](https://spdx.github.io/spdx-spec/v2.2.2/SPDX-license-expressions/), either version 2.2 or a later compatible version.
304+
305+
If you have multiple licenses, or a custom license, you can also express these using a license expression.
306+
307+
If you want to distribute license files, or other files containing legal information, with your package, you can include these using the [`license-files`](https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license-files) entry, but this is not required.
308+
304309
### Step 3: Specify Python version with `requires-python`
305310

306311
Add the `requires-python` field to your `pyproject.toml` `[project]` table.
@@ -663,7 +668,7 @@ readme = "README.md"
663668

664669
# Pick your license using license expression syntax specified here:
665670
# https://packaging.python.org/en/latest/specifications/license-expression/
666-
# We suggest MIT, BSD-3-Clause or Apache-2.0 if you are corporate
671+
# We suggest MIT, BSD-3-Clause or Apache-2.0
667672
license = "MIT"
668673

669674
# Add urls for your home page, issue tracker and source code

0 commit comments

Comments
 (0)