license_conflicts 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 71e417d8704344ac7126fa69287e32f7b13f7a4a67f8ef6fdb1bb0cfee5efdb9
4
- data.tar.gz: e9f2fe086f42d0e7ecb76931a8017ff4e9234fd31e88263d16f34c28469fe15e
3
+ metadata.gz: e179a472650ff8248e2ffa7ea090a8f371507491ecff5b8697b15f4c0d30c29f
4
+ data.tar.gz: 4ee65ac584f95860f000bd47ca8c6ede41533b3ee7813d0dd3a7d180ca1afe8b
5
5
  SHA512:
6
- metadata.gz: 8e1000e39b9851c607324351e1df775725dcb5179453ec771a3480cb1162da80c1d86a1f19189bce9ff4d397bce58ab142509cdce41d9aef181fadd7a6296a9b
7
- data.tar.gz: 8441600041254fea52ef4809efe234a70283bcf077efe2f4cf4a1d1cbbb2f7bc3ccf5f5608954e210207759260cd042384bbcea4dc200a5f45d782a2975b9e9b
6
+ metadata.gz: 6e54edda61e0605e88be0bb7c09fe832776513c96057412dd73b173cd0940fba8ed01a118ee23f0fd2aa98cda50880c7859deea04f5483c335e62e1510387734
7
+ data.tar.gz: 07d05b1f06a226d8aac10bc1f5a074dd84e17b95f982512de601323885349d5031cc6211e3d6d8aa80f1e4391ea164bc621b75c5787a6628e38c56d56504e2c0
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.3.1"
2
+ ".": "0.3.2"
3
3
  }
data/.rubocop.yml CHANGED
@@ -11,3 +11,9 @@ Style/StringLiteralsInInterpolation:
11
11
 
12
12
  Layout/LineLength:
13
13
  Max: 120
14
+
15
+ # RSpec specs use a single `describe` block per file, naturally above the default
16
+ # line limit; the limit does not apply to them.
17
+ Metrics/BlockLength:
18
+ Exclude:
19
+ - "spec/**/*"
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.2](https://github.com/dennisurtubia/license_conflicts/compare/license_conflicts/v0.3.1...license_conflicts/v0.3.2) (2026-09-13)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * conflicts mapping ([afcab97](https://github.com/dennisurtubia/license_conflicts/commit/afcab97686ffaa1351054667e027a683c64b78be))
9
+ * conflicts mapping ([4e4cd3a](https://github.com/dennisurtubia/license_conflicts/commit/4e4cd3abc017181e4d45a35cbcad376d6e359af5))
10
+
3
11
  ## [0.3.1](https://github.com/dennisurtubia/license_conflicts/compare/license_conflicts/v0.3.0...license_conflicts/v0.3.1) (2026-03-21)
4
12
 
5
13
 
@@ -1,52 +1,26 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # All license names in this file use the canonical form returned by
4
- # LicenseFinder (dependency.licenses.first.name). Input is normalised via
5
- # LicenseNormalizer before any lookup, so SPDX IDs and common aliases are
6
- # handled transparently.
7
-
3
+ # Key: declared license of the EXAMINED PROJECT.
4
+ # Value: DEPENDENCY licenses that conflict with it, i.e. licenses that
5
+ # CANNOT be relicensed/combined under the project's license.
6
+ #
7
+ # Directional semantics (Kapitsaki et al. 2017, Definition 1 and Fig. 2):
8
+ # conflict(project P, dependency D) <=> there is no path D -> P in the
9
+ # article's compatibility graph.
10
+ #
11
+ # Documented assumptions/limitations:
12
+ # - Single-licensed projects only (OR/AND multi-licensing is out of scope).
13
+ # - Flattened names treated as the exact version ("only"): "GPLv2" = GPL-2.0-only, etc.
14
+ # - Canonical names as returned by LicenseFinder, normalized via LicenseNormalizer.
15
+ #
16
+ # rubocop:disable Metrics/ModuleLength -- hardcoded data map, long by nature.
8
17
  module LicenseConflicts
9
- APACHE2_CONFLICTS = [
10
- "MIT",
11
- "New BSD",
12
- "Simplified BSD",
13
- "Zlib",
14
- "MPL 1.1",
15
- "CDDL 1.0",
16
- "AGPL 1.0"
17
- ].freeze
18
-
19
- NEW_BSD_CONFLICTS = [
20
- "MIT",
21
- "Simplified BSD",
22
- "Zlib",
23
- "MPL 1.1",
24
- "CDDL 1.0",
25
- "AGPL 1.0"
26
- ].freeze
27
-
28
- GPL2_CONFLICTS = [
18
+ ALL_LICENSES = [
29
19
  "MIT",
30
20
  "Simplified BSD",
31
21
  "New BSD",
32
- "Apache 2.0",
33
22
  "Zlib",
34
- "AFL 3.0",
35
- "MPL 1.1",
36
- "MPL 2.0",
37
- "CDDL 1.0",
38
- "LGPL 2.1",
39
- "LGPL 3.0",
40
- "OSL 3.0",
41
- "AGPL 1.0"
42
- ].freeze
43
-
44
- GPL3_CONFLICTS = [
45
- "MIT",
46
- "Simplified BSD",
47
- "New BSD",
48
23
  "Apache 2.0",
49
- "Zlib",
50
24
  "AFL 3.0",
51
25
  "MPL 1.1",
52
26
  "MPL 2.0",
@@ -55,114 +29,101 @@ module LicenseConflicts
55
29
  "LGPL 3.0",
56
30
  "OSL 3.0",
57
31
  "GPLv2",
58
- "AGPL 1.0"
32
+ "GPLv3",
33
+ "AGPL 1.0",
34
+ "AGPL 3"
59
35
  ].freeze
60
36
 
61
- MPL2_CONFLICTS = [
62
- "MIT",
63
- "Simplified BSD",
64
- "New BSD",
65
- "Apache 2.0",
66
- "Zlib",
67
- "AFL 3.0",
68
- "MPL 1.1",
69
- "CDDL 1.0",
70
- "LGPL 3.0",
71
- "OSL 3.0",
72
- "AGPL 1.0"
73
- ].freeze
37
+ CONFLICTS_MAP = {
38
+ # Only MIT code (and public domain) can be relicensed as MIT.
39
+ "MIT" => (ALL_LICENSES - ["MIT"]).freeze,
74
40
 
75
- SIMPLIFIED_BSD_CONFLICTS = [
76
- "MIT",
77
- "Zlib",
78
- "MPL 1.1",
79
- "CDDL 1.0",
80
- "AGPL 1.0"
81
- ].freeze
41
+ "Simplified BSD" => (ALL_LICENSES - ["MIT", "Simplified BSD"]).freeze,
82
42
 
83
- CONFLICTS_MAP = {
84
- "MIT" => [
85
- "Zlib",
86
- "MPL 1.1",
87
- "CDDL 1.0",
88
- "AGPL 1.0"
89
- ],
90
- "Simplified BSD" => SIMPLIFIED_BSD_CONFLICTS,
91
- "New BSD" => NEW_BSD_CONFLICTS,
92
- "Apache 2.0" => APACHE2_CONFLICTS,
93
- "Zlib" => [
94
- "MIT",
95
- "New BSD",
96
- "Simplified BSD",
43
+ "New BSD" => (ALL_LICENSES - ["MIT", "Simplified BSD", "New BSD"]).freeze,
44
+
45
+ # No other license flows into Zlib in the article's graph.
46
+ "Zlib" => (ALL_LICENSES - ["Zlib"]).freeze,
47
+
48
+ # Permissive licenses (MIT, BSDs, Zlib) flow into Apache-2.0; everything else conflicts.
49
+ "Apache 2.0" => [
50
+ "AFL 3.0",
97
51
  "MPL 1.1",
52
+ "MPL 2.0",
98
53
  "CDDL 1.0",
99
- "AGPL 1.0"
100
- ],
54
+ "LGPL 2.1",
55
+ "LGPL 3.0",
56
+ "OSL 3.0",
57
+ "GPLv2",
58
+ "GPLv3",
59
+ "AGPL 1.0",
60
+ "AGPL 3"
61
+ ].freeze,
62
+
101
63
  "AFL 3.0" => [
102
- "MIT",
103
- "Simplified BSD",
104
- "New BSD",
105
- "Apache 2.0",
106
64
  "MPL 1.1",
107
65
  "MPL 2.0",
108
66
  "CDDL 1.0",
109
67
  "LGPL 2.1",
110
68
  "LGPL 3.0",
69
+ "OSL 3.0",
111
70
  "GPLv2",
112
71
  "GPLv3",
113
- "AGPL 3",
114
- "Zlib",
115
- "AGPL 1.0"
116
- ],
117
- "MPL 1.1" => [
118
- "MIT",
119
- "Simplified BSD",
120
- "New BSD",
121
- "Apache 2.0",
122
- "Zlib",
72
+ "AGPL 1.0",
73
+ "AGPL 3"
74
+ ].freeze,
75
+
76
+ # No other license flows into MPL-1.1.
77
+ "MPL 1.1" => (ALL_LICENSES - ["MPL 1.1"]).freeze,
78
+
79
+ # MIT/BSDs (solid edge), Zlib/Apache-2.0 and MPL-1.1 (non-transitive edges as the
80
+ # last edge of the path) flow into MPL-2.0. Article's py2exe case: MIT + MPL-1.1
81
+ # are combinable under MPL-2.0.
82
+ "MPL 2.0" => [
123
83
  "AFL 3.0",
84
+ "CDDL 1.0",
85
+ "LGPL 2.1",
124
86
  "LGPL 3.0",
125
87
  "OSL 3.0",
126
- "AGPL 1.0"
127
- ],
128
- "MPL 2.0" => MPL2_CONFLICTS,
129
- "CDDL 1.0" => [
130
- "MIT",
131
- "Simplified BSD",
132
- "New BSD",
133
- "Apache 2.0",
88
+ "GPLv2",
89
+ "GPLv3",
90
+ "AGPL 1.0",
91
+ "AGPL 3"
92
+ ].freeze,
93
+
94
+ # Only MPL-1.1 flows into CDDL-1.0 (CDDL is derived from MPL-1.1).
95
+ "CDDL 1.0" => (ALL_LICENSES - ["MPL 1.1", "CDDL 1.0"]).freeze,
96
+
97
+ # Zlib and Apache-2.0 do NOT flow into LGPL-2.1 (explicit incompatibility in the
98
+ # article -- Shopware case). GPL cannot flow "back" into LGPL.
99
+ "LGPL 2.1" => [
134
100
  "Zlib",
101
+ "Apache 2.0",
135
102
  "AFL 3.0",
136
103
  "MPL 1.1",
137
- "MPL 2.0",
138
- "LGPL 2.1",
104
+ "CDDL 1.0",
139
105
  "LGPL 3.0",
140
106
  "OSL 3.0",
141
107
  "GPLv2",
142
108
  "GPLv3",
143
- "AGPL 3",
144
- "AGPL 1.0"
145
- ],
146
- "LGPL 2.1" => [
147
- "MIT",
148
- "Simplified BSD",
149
- "New BSD",
150
- "Apache 2.0",
151
- "Zlib",
109
+ "AGPL 1.0",
110
+ "AGPL 3"
111
+ ].freeze,
112
+
113
+ # Apache-2.0 and Zlib flow into LGPL-3.0 (unlike LGPL-2.1).
114
+ "LGPL 3.0" => [
152
115
  "AFL 3.0",
153
116
  "MPL 1.1",
154
- "MPL 2.0",
155
117
  "CDDL 1.0",
118
+ "LGPL 2.1",
156
119
  "OSL 3.0",
157
- "AGPL 1.0"
158
- ],
120
+ "GPLv2",
121
+ "GPLv3",
122
+ "AGPL 1.0",
123
+ "AGPL 3"
124
+ ].freeze,
125
+
159
126
  "OSL 3.0" => [
160
- "MIT",
161
- "Simplified BSD",
162
- "New BSD",
163
- "Apache 2.0",
164
- "Zlib",
165
- "AFL 3.0",
166
127
  "MPL 1.1",
167
128
  "MPL 2.0",
168
129
  "CDDL 1.0",
@@ -170,43 +131,49 @@ module LicenseConflicts
170
131
  "LGPL 3.0",
171
132
  "GPLv2",
172
133
  "GPLv3",
173
- "AGPL 3",
174
- "AGPL 1.0"
175
- ],
176
- "GPLv2" => GPL2_CONFLICTS,
177
- "GPLv3" => GPL3_CONFLICTS,
178
- "AGPL 3" => [
179
- "MIT",
180
- "Simplified BSD",
181
- "New BSD",
182
- "Apache 2.0",
134
+ "AGPL 1.0",
135
+ "AGPL 3"
136
+ ].freeze,
137
+
138
+ # Apache-2.0 and Zlib are incompatible with GPL-2.0 (explicit examples in the
139
+ # article, Section 4.1 and Table 4). GPLv3 incompatible with GPLv2 "and vice versa".
140
+ "GPLv2" => [
183
141
  "Zlib",
142
+ "Apache 2.0",
184
143
  "AFL 3.0",
185
144
  "MPL 1.1",
186
- "MPL 2.0",
187
145
  "CDDL 1.0",
188
- "LGPL 2.1",
189
146
  "LGPL 3.0",
190
147
  "OSL 3.0",
191
- "GPLv2",
192
148
  "GPLv3",
193
- "AGPL 1.0"
194
- ],
195
- "AGPL 1.0" => [
196
- "MIT",
197
- "Simplified BSD",
198
- "New BSD",
199
- "Apache 2.0",
200
- "Zlib",
149
+ "AGPL 1.0",
150
+ "AGPL 3"
151
+ ].freeze,
152
+
153
+ # Apache-2.0, Zlib, MPL-2.0 and the LGPLs flow into GPL-3.0.
154
+ "GPLv3" => [
201
155
  "AFL 3.0",
202
156
  "MPL 1.1",
203
- "MPL 2.0",
204
157
  "CDDL 1.0",
205
- "LGPL 2.1",
206
- "LGPL 3.0",
207
158
  "OSL 3.0",
208
159
  "GPLv2",
209
- "GPLv3"
210
- ]
160
+ "AGPL 1.0",
161
+ "AGPL 3"
162
+ ].freeze,
163
+
164
+ # Exact-only assumption: nothing flows into AGPL-1.0 (in the article's graph the
165
+ # node is AGPL-1.0+, with an outgoing edge only to AGPL-3.0).
166
+ "AGPL 1.0" => (ALL_LICENSES - ["AGPL 1.0"]).freeze,
167
+
168
+ # GPL-3.0 flows into AGPL-3.0 (GPLv3 clause 13); GPL-2.0 does not (Odoo case).
169
+ "AGPL 3" => [
170
+ "AFL 3.0",
171
+ "MPL 1.1",
172
+ "CDDL 1.0",
173
+ "OSL 3.0",
174
+ "GPLv2",
175
+ "AGPL 1.0"
176
+ ].freeze
211
177
  }.freeze
212
178
  end
179
+ # rubocop:enable Metrics/ModuleLength
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LicenseConflicts
4
- VERSION = "0.3.1"
4
+ VERSION = "0.3.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: license_conflicts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dennis Urtubia