Skip to content

Commit e822d0b

Browse files
authored
Merge pull request #88 from EmilienM/license-bug
fix(skill): prevent GPL licenses from being classified as compatible
2 parents 7fc4285 + 79a8d3d commit e822d0b

File tree

1 file changed

+37
-13
lines changed
  • helpers/skills/python-packaging-license-checker

1 file changed

+37
-13
lines changed

helpers/skills/python-packaging-license-checker/SKILL.md

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,19 @@ When a user provides a license name and asks about compatibility for redistribut
2525
- Try full name matching
2626
- Try partial/fuzzy matching for common variations
2727

28-
3. **Risk Classification**:
28+
3. **Risk Classification** (check strong copyleft FIRST to prevent misclassification):
2929
```
30-
IF (isOsiApproved AND isFsfLibre AND permissive_pattern):
31-
Risk = Low, Status = Compatible
30+
IF (strong_copyleft_pattern):
31+
Risk = High, Status = Restricted/Incompatible
32+
# GPL, AGPL are ALWAYS restricted regardless of OSI/FSF status
33+
ELIF (NOT isOsiApproved):
34+
Risk = High, Status = Restricted/Incompatible
3235
ELIF (isOsiApproved AND weak_copyleft_pattern):
3336
Risk = Medium, Status = Compatible with Requirements
34-
ELIF (strong_copyleft_pattern OR NOT isOsiApproved):
35-
Risk = High, Status = Restricted/Incompatible
37+
ELIF (isOsiApproved AND isFsfLibre AND permissive_pattern):
38+
Risk = Low, Status = Compatible
39+
ELSE:
40+
Risk = High, Status = Unknown - requires manual review
3641
```
3742

3843
4. **Generate Assessment**:
@@ -60,24 +65,43 @@ When processing SPDX license data, examine these key fields:
6065
- `reference`: URL to full license details
6166
- `seeAlso`: Array of additional reference URLs
6267

68+
### License Pattern Definitions
69+
70+
Use these explicit pattern lists for classification. Match against the SPDX `licenseId` field (case-insensitive).
71+
72+
#### Permissive Patterns (permissive_pattern)
73+
Licenses where the `licenseId` contains or matches any of:
74+
- `MIT`, `Apache-`, `BSD-`, `ISC`, `Unlicense`, `0BSD`, `PSF-`, `Python-`, `Zlib`, `BSL-1.0`, `CC0-`, `WTFPL`, `MulanPSL-`
75+
76+
#### Weak Copyleft Patterns (weak_copyleft_pattern)
77+
Licenses where the `licenseId` contains or matches any of:
78+
- `LGPL-`, `MPL-`, `EPL-`, `CDDL-`, `CPL-`, `CeCILL-2.1`, `EUPL-`
79+
80+
#### Strong Copyleft Patterns (strong_copyleft_pattern)
81+
Licenses where the `licenseId` contains or matches any of:
82+
- `GPL-` (but NOT `LGPL-`), `AGPL-`, `SSPL-`, `OSL-`, `CeCILL-` (but NOT `CeCILL-2.1`), `EUPL-` (when used with strong copyleft intent)
83+
84+
**CRITICAL**: `GPL-2.0`, `GPL-3.0`, `GPL-2.0-only`, `GPL-2.0-or-later`, `GPL-3.0-only`, `GPL-3.0-or-later` are ALL strong copyleft. They are NOT permissive. They MUST be classified as Restricted/Incompatible for commercial wheel redistribution.
85+
6386
### Compatibility Assessment Logic
6487

65-
Use SPDX flags and license patterns to determine compatibility:
88+
Use SPDX flags and the pattern definitions above to determine compatibility:
6689

6790
#### ✅ Highly Compatible (Low Risk)
68-
- OSI Approved AND FSF Libre
69-
- Permissive licenses (MIT, Apache, BSD, ISC family)
70-
- No strong copyleft requirements
91+
- OSI Approved AND FSF Libre AND matches permissive_pattern
92+
- Examples: MIT, Apache-2.0, BSD-3-Clause, ISC, PSF-2.0
93+
- No copyleft requirements of any kind
7194

7295
#### ⚠️ Compatible with Requirements (Medium Risk)
73-
- OSI Approved but specific obligations
74-
- Weak copyleft (LGPL, MPL)
75-
- File-level copyleft licenses
96+
- OSI Approved AND matches weak_copyleft_pattern
97+
- Examples: LGPL-2.1-only, LGPL-3.0-or-later, MPL-2.0
98+
- File-level or library-level copyleft only
7699

77100
#### ❌ Restricted/High Risk
78-
- Strong copyleft (GPL, AGPL)
101+
- Matches strong_copyleft_pattern (GPL, AGPL) — regardless of OSI or FSF status
79102
- Non-OSI approved licenses
80103
- Proprietary or unclear terms
104+
- GPL licenses require ALL derivative works to be released under the same GPL license, making them incompatible with proprietary or commercial redistribution of binary wheels
81105

82106
### Output Format
83107

0 commit comments

Comments
 (0)