MT010: LicenseCompatibilityCheck

Overview

Property Value
ID MT010
Name LicenseCompatibilityCheck
Group metadata
Severity WARNING

Description

Checks that your project’s license is compatible with the licenses of your dependencies.

License compatibility is important for:

  • Legal compliance when distributing your package
  • Avoiding license violations in production software
  • Ensuring users can legally use your package

What it checks

The check verifies that:

  1. Your project has a declared license
  2. Your dependencies have compatible licenses
  3. No copyleft licenses conflict with permissive licenses

For example, if your project uses MIT license but depends on a GPL-licensed package, this could create compatibility issues depending on how the dependency is used.

How to fix

Option 1: Change your license

If you’re using dependencies with copyleft licenses (GPL, AGPL), consider:

[project]
license = {text = "GPL-3.0-only"}

Option 2: Replace incompatible dependencies

Find alternative packages with compatible licenses:

[project]
dependencies = [
    "compatible-package>=1.0",  # MIT licensed alternative
]

Option 3: Isolate the dependency

Some license compatibility issues can be resolved through:

  • Dynamic linking vs static linking
  • Subprocess isolation
  • Optional dependencies

License compatibility matrix

Your License Compatible With Incompatible With
MIT MIT, BSD, Apache-2.0, ISC -
Apache-2.0 MIT, BSD, Apache-2.0 GPL-2.0-only (one-way)
GPL-3.0 MIT, BSD, Apache-2.0, GPL-3.0, LGPL-3.0 GPL-2.0-only
LGPL-3.0 MIT, BSD, Apache-2.0 (for linking) -

Common scenarios

Permissive project with permissive dependencies (OK):

[project]
license = {text = "MIT"}
dependencies = ["requests", "click"]  # Both MIT-compatible

Copyleft dependency requires copyleft project:

[project]
license = {text = "GPL-3.0-only"}  # Required if using GPL deps
dependencies = ["some-gpl-package"]

Understanding license types

Type Examples Key characteristic
Permissive MIT, BSD, Apache-2.0 Minimal restrictions
Weak copyleft LGPL, MPL Copyleft for library only
Strong copyleft GPL, AGPL Copyleft for entire work

Configuration

Skip this check

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

Exclude specific dependencies

[tool.pycmdcheck]
license_compatibility_exclude = ["dev-only-package"]

CLI

pycmdcheck --skip MT010