diff options
| author | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2023-01-20 11:11:24 +0000 |
|---|---|---|
| committer | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2023-01-20 11:11:24 +0000 |
| commit | cf9351dee7e8ec475468f83ecfb2e5f2de1b0ebe (patch) | |
| tree | 106b027d2918b10c715677dd1a85b9bd16477931 /setuptools/command/egg_info.py | |
| parent | ca3198a52d48123d4d8e67952f1c9d5abba38d1f (diff) | |
| parent | 58fa95e468242d41dd8d53e0d92429e964eaeb59 (diff) | |
| download | python-setuptools-git-cf9351dee7e8ec475468f83ecfb2e5f2de1b0ebe.tar.gz | |
Automatically add files referenced by configuration to sdist (#3779)
Diffstat (limited to 'setuptools/command/egg_info.py')
| -rw-r--r-- | setuptools/command/egg_info.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 1885efb0..86e99dd2 100644 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -565,6 +565,7 @@ class manifest_maker(sdist): if os.path.exists(self.template): self.read_template() self.add_license_files() + self._add_referenced_files() self.prune_file_list() self.filelist.sort() self.filelist.remove_duplicates() @@ -619,9 +620,16 @@ class manifest_maker(sdist): license_files = self.distribution.metadata.license_files or [] for lf in license_files: log.info("adding license file '%s'", lf) - pass self.filelist.extend(license_files) + def _add_referenced_files(self): + """Add files referenced by the config (e.g. `file:` directive) to filelist""" + referenced = getattr(self.distribution, '_referenced_files', []) + # ^-- fallback if dist comes from distutils or is a custom class + for rf in referenced: + log.debug("adding file referenced by config '%s'", rf) + self.filelist.extend(referenced) + def prune_file_list(self): build = self.get_finalized_command('build') base_dir = self.distribution.get_fullname() |
