diff options
| author | Tim Heap <tim@timheap.me> | 2016-11-21 01:44:22 +0200 |
|---|---|---|
| committer | Tim Heap <tim@timheap.me> | 2016-11-21 01:44:22 +0200 |
| commit | 23aba916e1070d3cf9723af85a6ce07c89053931 (patch) | |
| tree | 2c2338eb30dfc56cc83d4aab437c2ce9c68da0fe /setuptools | |
| parent | e8d53c0b830744a3cec9c0080293c39dfbf5ac72 (diff) | |
| download | external_python_setuptools-23aba916e1070d3cf9723af85a6ce07c89053931.tar.gz external_python_setuptools-23aba916e1070d3cf9723af85a6ce07c89053931.tar.bz2 external_python_setuptools-23aba916e1070d3cf9723af85a6ce07c89053931.zip | |
Fix #849 global-exclude globbing
After #764, `global-exclude .pyc` no longer excluded `.pyc` files.
This fixes that regression, and adds a test for this behaviour.
Diffstat (limited to 'setuptools')
| -rwxr-xr-x | setuptools/command/egg_info.py | 4 | ||||
| -rw-r--r-- | setuptools/tests/test_manifest.py | 12 |
2 files changed, 14 insertions, 2 deletions
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 6cc8f4c4..c4555b3e 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -457,7 +457,7 @@ class FileList(_FileList): """ if self.allfiles is None: self.findall() - match = translate_pattern(os.path.join('**', pattern)) + match = translate_pattern(os.path.join('**', '*' + pattern)) found = [f for f in self.allfiles if match.match(f)] self.extend(found) return bool(found) @@ -466,7 +466,7 @@ class FileList(_FileList): """ Exclude all files anywhere that match the pattern. """ - match = translate_pattern(os.path.join('**', pattern)) + match = translate_pattern(os.path.join('**', '*' + pattern)) return self._remove_files(match.match) def append(self, item): diff --git a/setuptools/tests/test_manifest.py b/setuptools/tests/test_manifest.py index 602c43a2..62b6d708 100644 --- a/setuptools/tests/test_manifest.py +++ b/setuptools/tests/test_manifest.py @@ -449,6 +449,11 @@ class TestFileListTest(TempDirTestCase): assert file_list.files == ['a.py', l('d/c.py')] self.assertWarnings() + file_list.process_template_line('global-include .txt') + file_list.sort() + assert file_list.files == ['a.py', 'b.txt', l('d/c.py')] + self.assertNoWarnings() + def test_global_exclude(self): l = make_local_path # global-exclude @@ -465,6 +470,13 @@ class TestFileListTest(TempDirTestCase): assert file_list.files == ['b.txt'] self.assertWarnings() + file_list = FileList() + file_list.files = ['a.py', 'b.txt', l('d/c.pyc'), 'e.pyo'] + file_list.process_template_line('global-exclude .py[co]') + file_list.sort() + assert file_list.files == ['a.py', 'b.txt'] + self.assertNoWarnings() + def test_recursive_include(self): l = make_local_path # recursive-include |
