# HG changeset patch # User Éric Araujo # Date 1281737118 -7200 # Branch manifest-exclude-build # Node ID f45e0360b250488e73c9fe41834c2ba414df6820 # Parent 4ca9910ec22649c021d87e6c9309016e75e10d27 Add a test for #6884 (wrong exclusion of buildout.cfg) diff --git a/Lib/distutils/tests/test_sdist.py b/Lib/distutils/tests/test_sdist.py --- a/Lib/distutils/tests/test_sdist.py +++ b/Lib/distutils/tests/test_sdist.py @@ -79,6 +79,34 @@ class SDistTestCase(PyPIRCCommandTestCas cmd.warn = _warn return dist, cmd + def test_include_file_list(self): + # test MANIFEST.in vs. built-in exclude filters (#6884) + dist, cmd = self.get_cmd() + cmd.ensure_finalized() + + self.write_file((self.tmp_dir, 'buildout.cfg'), '# buildout config') + self.write_file((self.tmp_dir, cmd.template), 'include buildout.cfg') + + # run build to create a directory that will trigger an exclude pattern + # wrongly matching buildout.cfg on win32 + dist.packages = ['somecode'] + build = dist.get_command_obj('build') + build.build_base = 'build' + build.ensure_finalized() + build.run() + self.assertTrue(os.path.isdir(join(self.tmp_dir, 'build'))) + + # run sdist and check the manifest + cmd.run() + + fp = open(join(self.tmp_dir, cmd.manifest)) + try: + manifest = fp.read().splitlines() + finally: + fp.close() + self.assertEqual(manifest, ['README', 'buildout.cfg', 'setup.py', + 'somecode/__init__.py']) + def test_prune_file_list(self): # this test creates a package with some vcs dirs in it # and launch sdist to make sure they get pruned