-
Notifications
You must be signed in to change notification settings - Fork 72
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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. | ||
|
||
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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
|
||
### What license should you use? | ||
|
||
We suggest that you use a permissive license that accommodates the other most commonly used licenses in the scientific Python ecosystem (MIT[^mit] and BSD-3[^bsd3]). If you are unsure, use MIT given it's the generally recommended | ||
We suggest that you use a permissive license that accommodates the other most commonly used licenses in the scientific Python ecosystem (MIT[^mit] and BSD-3-Clause[^bsd3]). If you are unsure, use MIT given it's the generally recommended | ||
license on [choosealicense.com](https://choosealicense.com/). | ||
|
||
:::{admonition} Licenses for the scientific Python ecosystem | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
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". | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
||
{emphasize-lines="20-21"} | ||
```toml | ||
|
@@ -297,7 +299,7 @@ maintainers = [ | |
{ name = "New Friend", email = "newbie@pyopensci.org" } | ||
] | ||
readme = "README.md" | ||
license = {file = "LICENSE"} | ||
license = "MIT" | ||
``` | ||
### Step 3: Specify Python version with `requires-python` | ||
|
||
|
@@ -337,7 +339,7 @@ maintainers = [ | |
{ name = "New Friend", email = "newbie@pyopensci.org" } | ||
] | ||
readme = "README.md" | ||
license = {file = 'LICENSE'} | ||
license = "MIT" | ||
requires-python = ">=3.10" | ||
``` | ||
|
||
|
@@ -409,7 +411,7 @@ maintainers = [ | |
{ name = "New Friend", email = "newbie@pyopensci.org" } | ||
] | ||
readme = "README.md" | ||
license = {file = 'LICENSE'} | ||
license = "MIT" | ||
requires-python = ">=3.10" | ||
|
||
dependencies = ["numpy>=1.0", "requests==10.1", "pandas", "pydantic>=1.7,<2"] | ||
|
@@ -454,12 +456,11 @@ Review that list and add items below to your `pyproject.toml` file: | |
- development status | ||
- intended audiences | ||
- topic | ||
- license and | ||
- programming language support | ||
|
||
The classifier key should look something like the example below. A few notes: | ||
|
||
- Your classifier values might be different depending upon the license you have selected for your package, your intended audience, development status of your package and the Python versions that you support | ||
- Your classifier values might be different depending upon your intended audience, development status of your package and the Python versions that you support | ||
- You can add as many classifiers as you wish as long as you use the [designated PyPI classifier values](https://PyPI.org/classifiers/). | ||
|
||
{emphasize-lines="26-34"} | ||
|
@@ -484,7 +485,7 @@ maintainers = [ | |
{ name = "New Friend", email = "newbie@pyopensci.org" } | ||
] | ||
readme = "README.md" | ||
license = {file = 'LICENSE'} | ||
license = "MIT" | ||
requires-python = ">=3.10" | ||
|
||
dependencies = ["numpy>=1.0", "requests==10.1", "pandas", "pydantic>=1.7,<2"] | ||
|
@@ -493,7 +494,6 @@ classifiers = [ | |
"Development Status :: 4 - Beta", | ||
"Intended Audience :: Developers", | ||
"Topic :: Software Development :: Build Tools", | ||
"License :: OSI Approved :: MIT License", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
|
@@ -534,7 +534,7 @@ maintainers = [ | |
{ name = "New Friend", email = "newbie@pyopensci.org" } | ||
] | ||
readme = "README.md" | ||
license = {file = 'LICENSE'} | ||
license = "MIT" | ||
requires-python = ">=3.10" | ||
|
||
dependencies = ["numpy>=1.0", "requests==10.1", "pandas", "pydantic>=1.7,<2"] | ||
|
@@ -543,7 +543,6 @@ classifiers = [ | |
"Development Status :: 4 - Beta", | ||
"Intended Audience :: Developers", | ||
"Topic :: Software Development :: Build Tools", | ||
"License :: OSI Approved :: MIT License", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
|
@@ -585,7 +584,7 @@ maintainers = [ | |
{ name = "New Friend", email = "newbie@pyopensci.org" } | ||
] | ||
readme = "README.md" | ||
license = {file = 'LICENSE'} | ||
license = "MIT" | ||
requires-python = ">=3.10" | ||
|
||
dependencies = ["numpy>=1.0", "requests==10.1", "pandas", "pydantic>=1.7,<2"] | ||
|
@@ -594,7 +593,6 @@ classifiers = [ | |
"Development Status :: 4 - Beta", | ||
"Intended Audience :: Developers", | ||
"Topic :: Software Development :: Build Tools", | ||
"License :: OSI Approved :: MIT License", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
|
@@ -650,9 +648,6 @@ classifiers = [ | |
"Intended Audience :: Developers", | ||
"Topic :: Software Development :: Build Tools", | ||
|
||
# Pick your license (using syntax from the classifier page). We suggest MIT, BSD3 or Apache if you are corporate | ||
"License :: OSI Approved :: MIT License", | ||
|
||
# Specify the Python versions ensuring that you indicate you support Python 3. | ||
# this is only for PyPI and other metadata associated with your package - for your users to see | ||
"Programming Language :: Python :: 3 :: Only", # BE sure to specify that you use python 3.x | ||
|
@@ -665,7 +660,11 @@ dependencies = ["numpy>=1.0", "requests==10.1", "pandas", "pydantic>=1.7,<2"] | |
# This is the metadata that pip reads to understand what versions your package supports | ||
requires-python = ">=3.10" | ||
readme = "README.md" | ||
license = { file = "LICENSE" } | ||
|
||
# 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Personally, I would leave the |
||
license = "MIT" | ||
|
||
# Add urls for your home page, issue tracker and source code | ||
[project.urls] # Optional | ||
|
There was a problem hiding this comment.
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"