Skip to content

Commit 06faa0b

Browse files
committed
Allow unrecognised license IDs with FLIT_ALLOW_INVALID
1 parent 6d60848 commit 06faa0b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

flit_core/flit_core/config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,10 @@ def normalize_license_expr(s: str):
765765
try:
766766
info = licenses[ls]
767767
except KeyError:
768+
if os.environ.get('FLIT_ALLOW_INVALID'):
769+
log.warning("Invalid license ID {!r} allowed by FLIT_ALLOW_INVALID"
770+
.format(s))
771+
return s
768772
raise ConfigError(f"{s!r} is not a recognised SPDX license ID")
769773

770774
return info['id'] + ('+' if or_later else '')

0 commit comments

Comments
 (0)