|
| 1 | +================== |
| 2 | +License Expression |
| 3 | +================== |
| 4 | + |
| 5 | +:pep:`639` defined a new :ref:`pyproject.toml's license <pyproject-toml-license>` |
| 6 | +value and added a corresponding :ref:`core metadata License-Expression field |
| 7 | +<core-metadata-license-expression>`. |
| 8 | +This specification defines which license expressions are acceptable. |
| 9 | + |
| 10 | + |
| 11 | +Specification |
| 12 | +============= |
| 13 | + |
| 14 | +License can be defined as a text string that is a valid SPDX |
| 15 | +:term:`license expression <License Expression>`, |
| 16 | +as documented in the `SPDX specification <spdxpression_>`__, |
| 17 | +either Version 2.2 or a later compatible version. |
| 18 | + |
| 19 | +A license expression can use the following license identifiers: |
| 20 | + |
| 21 | +- Any SPDX-listed license short-form identifiers that are published in |
| 22 | + the `SPDX License List <spdxlist_>`__, |
| 23 | + version 3.17 or any later compatible version. |
| 24 | + |
| 25 | +- The custom ``LicenseRef-[idstring]`` string(s), where ``[idstring]`` is |
| 26 | + a unique string containing letters, numbers, ``.`` and/or ``-``, |
| 27 | + to identify licenses that are not included in the SPDX license list. |
| 28 | + The custom identifiers must follow the SPDX specification, |
| 29 | + `clause 10.1 <spdxcustom_>`__ of the given specification version. |
| 30 | + |
| 31 | + |
| 32 | +Examples of valid license expressions: |
| 33 | + |
| 34 | +.. code-block:: yaml |
| 35 | +
|
| 36 | + MIT |
| 37 | + BSD-3-Clause |
| 38 | + MIT AND (Apache-2.0 OR BSD-2-Clause) |
| 39 | + MIT OR GPL-2.0-or-later OR (FSFUL AND BSD-2-Clause) |
| 40 | + GPL-3.0-only WITH Classpath-Exception-2.0 OR BSD-3-Clause |
| 41 | + LicenseRef-Special-License OR CC0-1.0 OR Unlicense |
| 42 | + LicenseRef-Proprietary |
| 43 | +
|
| 44 | +
|
| 45 | +Examples of invalid license expressions: |
| 46 | + |
| 47 | +.. code-block:: yaml |
| 48 | +
|
| 49 | + Use-it-after-midnight # No `LicenseRef` prefix |
| 50 | + Apache-2.0 OR 2-BSD-Clause # 2-BSD-Clause is not a valid SPDX identifier |
| 51 | + LicenseRef-License with spaces # spaces are not allowed |
| 52 | + LicenseRef-License_with_underscores # underscore are not allowed |
| 53 | +
|
| 54 | +.. _spdxcustom: https://spdx.github.io/spdx-spec/v2.2.2/other-licensing-information-detected/ |
| 55 | +.. _spdxlist: https://spdx.org/licenses/ |
| 56 | +.. _spdxpression: https://spdx.github.io/spdx-spec/v2.2.2/SPDX-license-expressions/ |
0 commit comments