From 87e487ee6080b98b328c3986d42e52e256f78bde Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Sat, 22 May 2021 13:45:14 +0200 Subject: [PATCH] Revert removal of license_file --- setuptools/dist.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/setuptools/dist.py b/setuptools/dist.py index a26a57cc65..5117681a53 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -411,6 +411,7 @@ class Distribution(_Distribution): 'long_description_content_type': lambda: None, 'project_urls': dict, 'provides_extras': ordered_set.OrderedSet, + 'license_file': lambda: None, 'license_files': lambda: None, } @@ -576,10 +577,7 @@ def _finalize_license_files(self): license_files: Optional[List[str]] = self.metadata.license_files patterns: List[str] = license_files if license_files else [] - license_file: Optional[str] = None - opts = self.get_option_dict('metadata') - if 'license_file' in opts: - license_file = opts['license_file'][1] + license_file: Optional[str] = self.metadata.license_file if license_file and license_file not in patterns: patterns.append(license_file)