Skip to content

Commit

Permalink
Allow unrecognised license IDs with FLIT_ALLOW_INVALID
Browse files Browse the repository at this point in the history
  • Loading branch information
takluyver committed Jan 20, 2025
1 parent 6d60848 commit 06faa0b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions flit_core/flit_core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Check warning on line 769 in flit_core/flit_core/config.py

View check run for this annotation

Codecov / codecov/patch

flit_core/flit_core/config.py#L769

Added line #L769 was not covered by tests
.format(s))
return s

Check warning on line 771 in flit_core/flit_core/config.py

View check run for this annotation

Codecov / codecov/patch

flit_core/flit_core/config.py#L771

Added line #L771 was not covered by tests
raise ConfigError(f"{s!r} is not a recognised SPDX license ID")

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

0 comments on commit 06faa0b

Please sign in to comment.