Skip to content

Remove "License :: ..." classifiers from pyproject.toml examples #564

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tomalrussell
Copy link
Contributor

Also update recommended use of "license = ..." key to use the short reference code for common licenses, rather than the legacy { file = "LICENSE" } specification.

See #557 for discussion

Update use of "license = ..." key to use short reference.

See pyOpenSci#557 for discussion
Copy link
Collaborator

@ucodery ucodery left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR! I really like your new descriptions of why to use classifiers, even without licenses.
The license metadata field used to be overloaded to mean two different things at the same time, depending on the type of value. Those meanings have been divided between two distinct fields and we should be explicit about that.

@@ -272,8 +272,10 @@ you want to have listed as authors and maintainers on your PyPI landing page.
### Step 2: Add README and license

In the previous lessons, you added both a [README.md](add-readme) file and a [LICENSE](add-license-coc) to your package repository.
Once you have those files, you can add them to your pyproject.toml file as
links following the example below.
Once you have those files, you can refer to the README from your pyproject.toml file, and add a short reference to your LICENSE
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The metadata no longer references the LICENSE, it now provides a SPDX summary expression of the LICENSE.

Once you have those files, you can refer to the README from your pyproject.toml file, and add a short reference to your LICENSE
following the example below.

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".
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use stronger language. The reference must use a valid SPDX license expression. This string is checked by both build tools and PyPI API and close (most often) won't cut it.


# Pick your license using license expression syntax specified here:
# https://packaging.python.org/en/latest/specifications/license-expression/
# We suggest MIT, BSD-3-Clause or Apache-2.0 if you are corporate
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I would leave the if you are corporate out. It leaves the question "what do I use if I'm not corporate" unanswered

@@ -26,13 +26,13 @@ In this lesson you will learn:
A license contains legal language about how users can use and reuse your software. To set the `LICENSE` for your project, you:

1. Create a `LICENSE` file in your project directory that specifies the license that you choose for your package.
2. Reference that file in your `pyproject.toml` data where metadata are set.
2. Reference that license in your `pyproject.toml` data where metadata are set.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a reference. I would say something like "describe your choice of license with a SPDX expression"


By adding the `LICENSE` file 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.
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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Under the new metadata, the LICENSE file will not be included unless the pytproject field project.license-files is specified. This field is not currently covered anywhere in the tutorial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants