Skip to content

Commit

Permalink
Don't emit warning for explicitly included data files
Browse files Browse the repository at this point in the history
  • Loading branch information
cdce8p committed Jan 4, 2025
1 parent 263c321 commit 00f7524
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions newsfragments/4789.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Don't emit ``Package would be ignored`` warning for explicitly included data files.
6 changes: 5 additions & 1 deletion setuptools/command/build_py.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ def analyze_manifest(self) -> None:
files = ei_cmd.filelist.files

check = _IncludePackageDataAbuse()
data_files = {
package: filenames
for package, _, _, filenames in self.get_data_files_without_manifest()
}
for path in self._filter_build_files(files, egg_info_dir):
d, f = os.path.split(assert_relative(path))
prev = None
Expand All @@ -208,7 +212,7 @@ def analyze_manifest(self) -> None:
continue # it's a module, not data
else:
importable = check.importable_subpackage(src_dirs[d], f)
if importable:
if importable and f not in data_files[d]:
check.warn(importable)
self.manifest_files.setdefault(src_dirs[d], []).append(path)

Expand Down

0 comments on commit 00f7524

Please sign in to comment.