MT011: OSIApprovedLicense

Overview

Property Value
ID MT011
Name OSIApprovedLicense
Group metadata
Severity WARNING

Description

Checks that the project’s license is an OSI-approved open source license.

The Open Source Initiative (OSI) maintains a list of licenses that meet the Open Source Definition, ensuring they provide the freedoms expected of open source software.

What it checks

The check validates that the license specified in pyproject.toml is on the OSI-approved license list:

  • Reads the license field from [project]
  • Validates against the OSI-approved license list
  • Supports both SPDX identifiers and common license names

Why it matters

  • Open Source Compliance - Ensures your project meets open source standards
  • Legal Clarity - OSI-approved licenses are well-understood legally
  • Compatibility - Makes it easier for others to use and contribute
  • pyOpenSci/JOSS - Required for pyOpenSci and JOSS review
  • Distribution - Some platforms and organizations require OSI-approved licenses

Common OSI-approved licenses

License SPDX Identifier
MIT License MIT
Apache License 2.0 Apache-2.0
BSD 3-Clause BSD-3-Clause
BSD 2-Clause BSD-2-Clause
GNU GPL v3 GPL-3.0
GNU LGPL v3 LGPL-3.0
Mozilla Public License 2.0 MPL-2.0
ISC License ISC

How to fix

Ensure your pyproject.toml specifies an OSI-approved license:

[project]
name = "my-package"
version = "1.0.0"
license = "MIT"  # or use SPDX identifier

Or with the table format:

[project]
license = {text = "MIT"}

Choosing a license

If you’re unsure which license to use:

  • MIT - Simple, permissive, widely used
  • Apache-2.0 - Permissive with patent protection
  • GPL-3.0 - Copyleft, requires derivative works to be open source
  • BSD-3-Clause - Similar to MIT with attribution requirement

See choosealicense.com for help selecting a license.

Configuration

Skip this check

[tool.pycmdcheck]
skip = ["MT011"]

CLI

pycmdcheck --skip MT011