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

Merged
merged 5 commits into from
Aug 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,6 @@ Classifiers are just a list of plain strings
```toml
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
]
```
Expand Down
2 changes: 1 addition & 1 deletion examples/extension-hatch/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ maintainers = [
description = "An example Python package used to support Python packaging tutorials"
keywords = ["pyOpenSci", "python packaging"]
readme = "README"
license = "BSD-3-Clause"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
]
2 changes: 1 addition & 1 deletion examples/pure-hatch/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ maintainers = [
description = "An example Python package used to support Python packaging tutorials"
keywords = ["pyOpenSci", "python packaging"]
readme = "README.md"
license = "BSD-3-Clause"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
]
dependencies = [
Expand Down
2 changes: 1 addition & 1 deletion examples/pure-setuptools/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ maintainers = [
description = "An example Python package used to support Python packaging tutorials"
keywords = ["pyOpenSci", "python packaging"]
readme = "README.md"
license = "BSD-3-Clause"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
]
dependencies = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ what dependencies your package requires.
- Development Status
- Intended Audience
- Topic
- License
- Programming language

### Advanced options in the pyproject.toml file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ dependencies = [

2. When the build tool creates your package distribution file (the file that you publish on PyPI), it also creates a METADATA file which PyPI can read and use to help users find your package. For example:

- The `classifiers = ` section of your `[project]` table in the pyproject.toml file provides information that users on PyPI can use to filter for packages that contain specific licenses or that support specific versions of python.
- The `classifiers = ` section of your `[project]` table in the pyproject.toml file provides information that users on PyPI can use to filter for packages that address different topics or that support specific versions of python.

```toml
classifiers = [
Expand All @@ -63,7 +63,6 @@ classifiers = [
# Indicate who your project is intended for
"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",
Expand Down
6 changes: 3 additions & 3 deletions tutorials/add-license-coc.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. Describe your choice of 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 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.

### 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
Expand Down
1 change: 0 additions & 1 deletion tutorials/create-python-package.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ readme = {"file" = "README.md", "content-type" = "text/markdown"}
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
]
Expand Down
38 changes: 21 additions & 17 deletions tutorials/pyproject-toml.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,8 @@ 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 code indicating your choice of LICENSE
following the example below.

{emphasize-lines="20-21"}
```toml
Expand All @@ -297,8 +297,15 @@ maintainers = [
{ name = "New Friend", email = "[email protected]" }
]
readme = "README.md"
license = {file = "LICENSE"}
license = "MIT"
```

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.

If you have multiple licenses, or a custom license, you can also express these using a license expression.

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.

### Step 3: Specify Python version with `requires-python`

Add the `requires-python` field to your `pyproject.toml` `[project]` table.
Expand Down Expand Up @@ -337,7 +344,7 @@ maintainers = [
{ name = "New Friend", email = "[email protected]" }
]
readme = "README.md"
license = {file = 'LICENSE'}
license = "MIT"
requires-python = ">=3.10"
```

Expand Down Expand Up @@ -409,7 +416,7 @@ maintainers = [
{ name = "New Friend", email = "[email protected]" }
]
readme = "README.md"
license = {file = 'LICENSE'}
license = "MIT"
requires-python = ">=3.10"

dependencies = ["numpy>=1.0", "requests==10.1", "pandas", "pydantic>=1.7,<2"]
Expand Down Expand Up @@ -454,12 +461,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"}
Expand All @@ -484,7 +490,7 @@ maintainers = [
{ name = "New Friend", email = "[email protected]" }
]
readme = "README.md"
license = {file = 'LICENSE'}
license = "MIT"
requires-python = ">=3.10"

dependencies = ["numpy>=1.0", "requests==10.1", "pandas", "pydantic>=1.7,<2"]
Expand All @@ -493,7 +499,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",
Expand Down Expand Up @@ -534,7 +539,7 @@ maintainers = [
{ name = "New Friend", email = "[email protected]" }
]
readme = "README.md"
license = {file = 'LICENSE'}
license = "MIT"
requires-python = ">=3.10"

dependencies = ["numpy>=1.0", "requests==10.1", "pandas", "pydantic>=1.7,<2"]
Expand All @@ -543,7 +548,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",
Expand Down Expand Up @@ -585,7 +589,7 @@ maintainers = [
{ name = "New Friend", email = "[email protected]" }
]
readme = "README.md"
license = {file = 'LICENSE'}
license = "MIT"
requires-python = ">=3.10"

dependencies = ["numpy>=1.0", "requests==10.1", "pandas", "pydantic>=1.7,<2"]
Expand All @@ -594,7 +598,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",
Expand Down Expand Up @@ -650,9 +653,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
Expand All @@ -665,7 +665,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 the license expression syntax specified here:
# https://packaging.python.org/en/latest/specifications/license-expression/
# We suggest MIT, BSD-3-Clause or Apache-2.0
license = "MIT"

# Add urls for your home page, issue tracker and source code
[project.urls] # Optional
Expand Down
Loading