From 56274b32724933cd2016488c4e667e86d30572ef Mon Sep 17 00:00:00 2001 From: Hatem Nassrat Date: Mon, 23 Jan 2017 18:07:21 +0000 Subject: fixes #935 - allows for glob syntax in graft --- setuptools/command/egg_info.py | 4 +++- setuptools/tests/test_manifest.py | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 5ab54dc7..62bf00aa 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -429,7 +429,9 @@ class FileList(_FileList): def graft(self, dir): """Include all files from 'dir/'.""" - found = distutils.filelist.findall(dir) + found = [] + for match_dir in glob(dir): + found += distutils.filelist.findall(match_dir) self.extend(found) return bool(found) diff --git a/setuptools/tests/test_manifest.py b/setuptools/tests/test_manifest.py index cf39346a..3b34c888 100644 --- a/setuptools/tests/test_manifest.py +++ b/setuptools/tests/test_manifest.py @@ -206,6 +206,15 @@ class TestManifestTest(TempDirTestCase): l('app/static/app.css'), l('app/static/app.css.map')]) assert files == self.get_files() + def test_graft_glob_syntax(self): + """Include the whole app/static/ directory.""" + l = make_local_path + self.make_manifest("graft */static") + files = default_files | set([ + l('app/static/app.js'), l('app/static/app.js.map'), + l('app/static/app.css'), l('app/static/app.css.map')]) + assert files == self.get_files() + def test_graft_global_exclude(self): """Exclude all *.map files in the project.""" l = make_local_path -- cgit v1.2.3