You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- 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
Copy file name to clipboardExpand all lines: tutorials/add-license-coc.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,9 +26,9 @@ In this lesson you will learn:
26
26
A license contains legal language about how users can use and reuse your software. To set the `LICENSE` for your project, you:
27
27
28
28
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.
30
30
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.
Copy file name to clipboardExpand all lines: tutorials/pyproject-toml.md
+9-4Lines changed: 9 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -272,11 +272,9 @@ you want to have listed as authors and maintainers on your PyPI landing page.
272
272
### Step 2: Add README and license
273
273
274
274
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
276
276
following the example below.
277
277
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
-
280
278
{emphasize-lines="20-21"}
281
279
```toml
282
280
[build-system]
@@ -301,6 +299,13 @@ maintainers = [
301
299
readme = "README.md"
302
300
license = "MIT"
303
301
```
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
+
304
309
### Step 3: Specify Python version with `requires-python`
305
310
306
311
Add the `requires-python` field to your `pyproject.toml``[project]` table.
@@ -663,7 +668,7 @@ readme = "README.md"
663
668
664
669
# Pick your license using license expression syntax specified here:
0 commit comments