Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion vinca/license_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,14 @@
"lgplv3": "LGPL-3.0-only",
"lgpl-3": "LGPL-3.0-only",
"lgpl-3.0": "LGPL-3.0-only",
"LGPL (amcl)": "LGPL-2.1-or-later",
# Mozilla/MPL variants
"mozilla": "MPL-2.0",
"mpl": "MPL-2.0",
"mozilla public license version 1.1": "MPL-1.1",
# Eclipse variants
"eclipse public license 2.0": "EPL-2.0",
"eclipse distribution license 1.0": "EDL-1.0",
"eclipse distribution license 1.0": "BSD-3-Clause",
# Boost variants
"boost": "BSL-1.0",
"boost software license": "BSL-1.0",
Expand All @@ -63,6 +64,7 @@
# Creative Commons
"cc by-nc-sa 4.0": "CC-BY-NC-SA-4.0",
"creative commons zero v1.0 universal": "CC0-1.0",
"creative commons": "CC0-1.0", # The version is an assumption
# Public Domain (choosing Unlicense as more appropriate for code)
"public domain": "Unlicense",
}
Expand Down
8 changes: 5 additions & 3 deletions vinca/test_license_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ def test_all_todos():

def test_license_with_spaces_converted():
"""Test licenses with spaces have spaces replaced with hyphens."""
result = convert_to_spdx_license(["Creative Commons"])
assert result == "LicenseRef-Creative-Commons"
result = convert_to_spdx_license(["My License"])
assert result == "LicenseRef-My-License"


def test_license_with_slashes_converted():
Expand Down Expand Up @@ -250,7 +250,9 @@ def test_additional_license_variants():

# Eclipse variants
assert convert_to_spdx_license(["Eclipse Public License 2.0"]) == "EPL-2.0"
assert convert_to_spdx_license(["Eclipse Distribution License 1.0"]) == "EDL-1.0"
assert (
convert_to_spdx_license(["Eclipse Distribution License 1.0"]) == "BSD-3-Clause"
)

# Zlib
assert convert_to_spdx_license(["zlib License"]) == "Zlib"
Expand Down