Skip to content

Bug: AGPL dependencies are read as GPL, so a GPL-3.0 project accepts them #154

Backlog

Description

@simonvanlierde

Before You Begin

  • I have checked for similar issues in the project's issue tracker.
  • I have searched closed issues to see if a similar problem was reported before.

Description

Hi, licence strings are matched on the longest known term they contain, and GPL-3.0-OR-LATER, GPL-3.0 and GPLV3 are all substrings of the AGPL names. So the AGPL entries never win:

  • AGPL-3.0-or-later is read as GPL_3_PLUS
  • AGPL-3.0-only, AGPL-3.0 and AGPLv3 are read as GPL_3

The matrix says a GPL-3.0 project can't take an AGPL dependency, but with the misread licence it passes. Only plain AGPL and the long Affero classifier reach AGPL_3_PLUS.

Expected Behavior

An AGPL dependency in a GPL-3.0-or-later project is reported as incompatible, whichever spelling it uses.

Actual Behavior

It's reported as compatible, through the API and the CLI.

System Information

  • licensecheck 2026.0.8, and master at 39b86d4
  • Python 3.12, Debian
Repro and output
from licensecheck.license_matrix import licenseType, depCompatWMyLice
(me,) = licenseType("GPL-3.0-or-later")
for dep in ["AGPL-3.0-or-later", "AGPL-3.0-only", "AGPL-3.0", "AGPLv3", "AGPL"]:
    d = licenseType(dep)
    print(dep, sorted(x.name for x in d), depCompatWMyLice(me, d))

Output, the same on 2026.0.8 and master:

AGPL-3.0-or-later ['GPL_3_PLUS'] True
AGPL-3.0-only ['GPL_3'] True
AGPL-3.0 ['GPL_3'] True
AGPLv3 ['GPL_3'] True
AGPL ['AGPL_3_PLUS'] False

Looking up AGPL before the GPL terms, or matching whole tokens, would fix it, I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions