Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support simple SPDX license expressions (PEP 639) #712

Merged
merged 8 commits into from
Feb 8, 2025
Prev Previous commit
Next Next commit
Allow unrecognised license IDs with FLIT_ALLOW_INVALID
  • Loading branch information
takluyver committed Jan 20, 2025
commit 06faa0bfdaa2a24e52b28efa4ce62eb2ae8b8d17
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 @@
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 '')
Loading