Skip to content

Commit

Permalink
Add back project.license.file to license files
Browse files Browse the repository at this point in the history
  • Loading branch information
takluyver committed Feb 8, 2025
1 parent 345bf1c commit 0d0d06b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion flit_core/flit_core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,14 @@ def read_pep621_metadata(proj, path) -> LoadedConfig:
raise ConfigError(
"[project.license] should specify file or text, not both"
)
lc.referenced_files.append(license_tbl['file'])
license_f = license_tbl['file']
if isabs_ish(license_f):
raise ConfigError(

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

View check run for this annotation

Codecov / codecov/patch

flit_core/flit_core/config.py#L608

Added line #L608 was not covered by tests
f"License file path ({license_f}) cannot be an absolute path"
)
if not (path.parent / license_f).is_file():
raise ConfigError(f"License file {license_f} does not exist")

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

View check run for this annotation

Codecov / codecov/patch

flit_core/flit_core/config.py#L612

Added line #L612 was not covered by tests
license_files.add(license_tbl['file'])
elif 'text' in license_tbl:
pass

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

View check run for this annotation

Codecov / codecov/patch

flit_core/flit_core/config.py#L615

Added line #L615 was not covered by tests
else:
Expand Down

0 comments on commit 0d0d06b

Please sign in to comment.