Skip to content

Commit 44303b6

Browse files
authored
Avoid raising exception when license-files is defined outside of pyproject.toml (#4899)
2 parents 70ecc10 + f9ad3e1 commit 44303b6

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

newsfragments/4899.bugfix.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Avoided eagerly raising an exception when ``license-files`` is defined
2+
simultaneously inside and outside of ``pyproject.toml``.
3+
Instead we rely on the existing deprecation error.

setuptools/config/_apply_pyprojecttoml.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ def _apply_tool_table(dist: Distribution, config: dict, filename: StrPath):
9090
return # short-circuit
9191

9292
if "license-files" in tool_table:
93-
if dist.metadata.license_files:
93+
if "license-files" in config.get("project", {}):
94+
# https://github.com/pypa/setuptools/pull/4837#discussion_r2004983349
9495
raise InvalidConfigError(
9596
"'project.license-files' is defined already. "
9697
"Remove 'tool.setuptools.license-files'."

0 commit comments

Comments
 (0)