@@ -598,6 +598,26 @@ def test_listed_in_dynamic(self, tmp_path, attr, field, value):
598
598
dist_value = _some_attrgetter (f"metadata.{ attr } " , attr )(dist )
599
599
assert dist_value == value
600
600
601
+ def test_license_files_exempt_from_dynamic (self , monkeypatch , tmp_path ):
602
+ """
603
+ license-file is currently not considered in the context of dynamic.
604
+ As per 2025-02-19, https://packaging.python.org/en/latest/specifications/pyproject-toml/#license-files
605
+ allows setuptools to fill-in `license-files` the way it sees fit:
606
+
607
+ > If the license-files key is not defined, tools can decide how to handle license files.
608
+ > For example they can choose not to include any files or use their own
609
+ > logic to discover the appropriate files in the distribution.
610
+
611
+ Using license_files from setup.py to fill-in the value is in accordance
612
+ with this rule.
613
+ """
614
+ monkeypatch .chdir (tmp_path )
615
+ pyproject = self .pyproject (tmp_path , [])
616
+ dist = makedist (tmp_path , license_files = ["LIC*" ])
617
+ (tmp_path / "LIC1" ).write_text ("42" , encoding = "utf-8" )
618
+ dist = pyprojecttoml .apply_configuration (dist , pyproject )
619
+ assert dist .metadata .license_files == ["LIC1" ]
620
+
601
621
def test_warning_overwritten_dependencies (self , tmp_path ):
602
622
src = "[project]\n name='pkg'\n version='0.1'\n dependencies=['click']\n "
603
623
pyproject = tmp_path / "pyproject.toml"
0 commit comments