From 433038627b625ca948796333f4a4f8cde03d68a5 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Sun, 20 Nov 2022 14:11:02 +0100 Subject: [PATCH] Add `tests/test*.py` to source distributions Because most Python packages maintain tests in top-level directory `tests/` instead of `test/`, add both to source distributions for consistency. --- distutils/command/sdist.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/distutils/command/sdist.py b/distutils/command/sdist.py index 5cfd4c14..76d0d865 100644 --- a/distutils/command/sdist.py +++ b/distutils/command/sdist.py @@ -235,7 +235,7 @@ def add_defaults(self): """Add all the default files to self.filelist: - README or README.txt - setup.py - - test/test*.py + - tests/test*.py and test/test*.py - all pure Python modules mentioned in setup script - all files pointed by package_data (build_py) - all files defined in data_files. @@ -293,7 +293,7 @@ def _add_defaults_standards(self): self.warn("standard file '%s' not found" % fn) def _add_defaults_optional(self): - optional = ['test/test*.py', 'setup.cfg'] + optional = ['tests/test*.py', 'test/test*.py', 'setup.cfg'] for pattern in optional: files = filter(os.path.isfile, glob(pattern)) self.filelist.extend(files)