From 06faa0bfdaa2a24e52b28efa4ce62eb2ae8b8d17 Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Mon, 20 Jan 2025 22:22:38 +0000 Subject: [PATCH] Allow unrecognised license IDs with FLIT_ALLOW_INVALID --- flit_core/flit_core/config.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flit_core/flit_core/config.py b/flit_core/flit_core/config.py index ed62ded4..c76a189e 100644 --- a/flit_core/flit_core/config.py +++ b/flit_core/flit_core/config.py @@ -765,6 +765,10 @@ def normalize_license_expr(s: str): try: info = licenses[ls] except KeyError: + if os.environ.get('FLIT_ALLOW_INVALID'): + log.warning("Invalid license ID {!r} allowed by FLIT_ALLOW_INVALID" + .format(s)) + return s raise ConfigError(f"{s!r} is not a recognised SPDX license ID") return info['id'] + ('+' if or_later else '')