diff options
author | Éric Araujo <merwok@netwok.org> | 2011-06-06 19:55:43 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2011-06-06 19:55:43 (GMT) |
commit | 7373fccd50516909574fc67bb92a899963e96ed9 (patch) | |
tree | ed0820b1cf1e2d1dca93fc3ea3ca2daa7e1911a8 /Lib/packaging/tests | |
parent | 078368fe4d9955890bf317481483b56752fb4ad2 (diff) | |
download | cpython-7373fccd50516909574fc67bb92a899963e96ed9.zip cpython-7373fccd50516909574fc67bb92a899963e96ed9.tar.gz cpython-7373fccd50516909574fc67bb92a899963e96ed9.tar.bz2 |
Fix sdist to always include setup.cfg (#11092), to comply with the spec
Diffstat (limited to 'Lib/packaging/tests')
-rw-r--r-- | Lib/packaging/tests/test_command_sdist.py | 13 | ||||
-rw-r--r-- | Lib/packaging/tests/test_create.py | 17 |
2 files changed, 19 insertions, 11 deletions
diff --git a/Lib/packaging/tests/test_command_sdist.py b/Lib/packaging/tests/test_command_sdist.py index 82f4b30..7be349f 100644 --- a/Lib/packaging/tests/test_command_sdist.py +++ b/Lib/packaging/tests/test_command_sdist.py @@ -34,6 +34,7 @@ setup(name='fake') MANIFEST = """\ # file GENERATED by packaging, do NOT edit inroot.txt +setup.cfg data%(sep)sdata.dt scripts%(sep)sscript.py some%(sep)sfile.txt @@ -173,6 +174,7 @@ class SDistTestCase(support.TempdirManager, # in package_data dist.package_data = {'': ['*.cfg', '*.dat'], 'somecode': ['*.txt']} + self.write_file((self.tmp_dir, 'setup.cfg'), '#') self.write_file((self.tmp_dir, 'somecode', 'doc.txt'), '#') self.write_file((self.tmp_dir, 'somecode', 'doc.dat'), '#') @@ -212,8 +214,8 @@ class SDistTestCase(support.TempdirManager, content = zip_file.namelist() # Making sure everything was added. This includes 8 code and data - # files in addition to PKG-INFO. - self.assertEqual(len(content), 9) + # files in addition to PKG-INFO and setup.cfg + self.assertEqual(len(content), 10) # Checking the MANIFEST with open(join(self.tmp_dir, 'MANIFEST')) as fp: @@ -230,7 +232,7 @@ class SDistTestCase(support.TempdirManager, cmd.ensure_finalized() cmd.run() warnings = self.get_logs(logging.WARN) - self.assertEqual(len(warnings), 3) + self.assertEqual(len(warnings), 4) # trying with a complete set of metadata self.loghandler.flush() @@ -242,8 +244,9 @@ class SDistTestCase(support.TempdirManager, # removing manifest generated warnings warnings = [warn for warn in warnings if not warn.endswith('-- skipping')] - # the remaining warning is about the use of the default file list - self.assertEqual(len(warnings), 1) + # the remaining warnings are about the use of the default file list and + # the absence of setup.cfg + self.assertEqual(len(warnings), 2) def test_show_formats(self): __, stdout = captured_stdout(show_formats) diff --git a/Lib/packaging/tests/test_create.py b/Lib/packaging/tests/test_create.py index 92a3ea4..a82ab43 100644 --- a/Lib/packaging/tests/test_create.py +++ b/Lib/packaging/tests/test_create.py @@ -66,10 +66,15 @@ class CreateTestCase(support.TempdirManager, # building the structure tempdir = self.wdir dirs = ['pkg1', 'data', 'pkg2', 'pkg2/sub'] - files = ['README', 'setup.cfg', 'foo.py', - 'pkg1/__init__.py', 'pkg1/bar.py', - 'data/data1', 'pkg2/__init__.py', - 'pkg2/sub/__init__.py'] + files = [ + 'README', + 'data/data1', + 'foo.py', + 'pkg1/__init__.py', + 'pkg1/bar.py', + 'pkg2/__init__.py', + 'pkg2/sub/__init__.py', + ] for dir_ in dirs: os.mkdir(os.path.join(tempdir, dir_)) @@ -86,8 +91,8 @@ class CreateTestCase(support.TempdirManager, ['pkg1', 'pkg2', 'pkg2.sub']) self.assertEqual(mainprogram.data['modules'], ['foo']) data_fn = os.path.join('data', 'data1') - self.assertEqual(set(mainprogram.data['extra_files']), - set(['setup.cfg', 'README', data_fn])) + self.assertEqual(mainprogram.data['extra_files'], + ['README', data_fn]) def test_convert_setup_py_to_cfg(self): self.write_file((self.wdir, 'setup.py'), |