Commit 98130f3
docs(conan): handle list-valued license in make_fossa_deps_conan (#1719)
* docs(conan): handle list-valued license in make_fossa_deps_conan
Conan recipes may declare `license` as either a single string ("MIT") or a
list/tuple of strings (["MIT", "Apache-2.0"]). Conan 2's `conan graph info
-f json` preserves that shape (ConanFile.serialize does
`list(self.license)` when it is not a string), so the script could emit a
YAML array into the fossa-deps `license` field, which must be a String:
Error in $['custom-dependencies'][N].license:
parsing Text failed, expected String, but encountered Array
license_of now normalizes any shape into a single string: a string passes
through, a list/tuple is joined into one SPDX expression via
MULTI_LICENSE_JOINER (" AND " by default), and empty/None becomes None.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* docs(conan): default missing license to NOASSERTION
A Conan recipe with no `license` made license_of return None, which dump()
wrote as `license: null`. fossa-deps requires a String for custom
dependencies, so this failed with:
Error in $['custom-dependencies'][N].license:
parsing Text failed, expected String, but encountered Null
Default a missing/empty license to the SPDX "NOASSERTION" marker so the
generated fossa-deps.yml stays valid.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent faf8907 commit 98130f3
1 file changed
Lines changed: 23 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
110 | 122 | | |
111 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
112 | 133 | | |
113 | 134 | | |
114 | 135 | | |
| |||
158 | 179 | | |
159 | 180 | | |
160 | 181 | | |
161 | | - | |
| 182 | + | |
162 | 183 | | |
163 | 184 | | |
164 | 185 | | |
| |||
0 commit comments