summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGodefroid Chapelle <gotcha@bubblenet.be>2011-01-28 18:40:08 +0100
committerGodefroid Chapelle <gotcha@bubblenet.be>2011-01-28 18:40:08 +0100
commit1a12c2179d620a411dee3c8c3239713faf7d050e (patch)
treec1a8a6793b191faffde44fbedeb22f5f590b6283
parentb1b694941f120f6ea2f1ac804972497745f47ce9 (diff)
downloaddisutils2-1a12c2179d620a411dee3c8c3239713faf7d050e.tar.gz
avoid inclusion of README or test/*.py
-rw-r--r--distutils2/command/sdist.py29
-rw-r--r--distutils2/tests/test_command_sdist.py10
2 files changed, 4 insertions, 35 deletions
diff --git a/distutils2/command/sdist.py b/distutils2/command/sdist.py
index df8e07a..fdd7543 100644
--- a/distutils2/command/sdist.py
+++ b/distutils2/command/sdist.py
@@ -214,8 +214,6 @@ class sdist(Command):
def add_defaults(self):
"""Add all the default files to self.filelist:
- - README or README.txt
- - 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.
@@ -225,32 +223,6 @@ class sdist(Command):
Warns if (README or README.txt) or setup.py are missing; everything
else is optional.
"""
- standards = [('README', 'README.txt')]
- for fn in standards:
- if isinstance(fn, tuple):
- alts = fn
- got_it = 0
- for fn in alts:
- if os.path.exists(fn):
- got_it = 1
- self.filelist.append(fn)
- break
-
- if not got_it:
- self.warn("standard file not found: should have one of " +
- string.join(alts, ', '))
- else:
- if os.path.exists(fn):
- self.filelist.append(fn)
- else:
- self.warn("standard file '%s' not found" % fn)
-
- optional = ['test/test*.py', 'setup.cfg']
- for pattern in optional:
- files = filter(os.path.isfile, glob(pattern))
- if files:
- self.filelist.extend(files)
-
for cmd_name in get_command_names():
try:
cmd_obj = self.get_finalized_command(cmd_name)
@@ -376,4 +348,3 @@ class sdist(Command):
# Now create them
for dir in need_dirs:
self.mkpath(dir, mode, verbose=verbose, dry_run=dry_run)
-
diff --git a/distutils2/tests/test_command_sdist.py b/distutils2/tests/test_command_sdist.py
index ebfc818..cdb0595 100644
--- a/distutils2/tests/test_command_sdist.py
+++ b/distutils2/tests/test_command_sdist.py
@@ -45,7 +45,6 @@ setup(name='fake')
MANIFEST = """\
# file GENERATED by distutils, do NOT edit
-README
inroot.txt
data%(sep)sdata.dt
scripts%(sep)sscript.py
@@ -141,7 +140,7 @@ class SDistTestCase(support.TempdirManager, support.LoggingCatcher,
zip_file.close()
# making sure everything has been pruned correctly
- self.assertEqual(len(content), 3)
+ self.assertEqual(len(content), 2)
@unittest.skipUnless(zlib, "requires zlib")
def test_make_distribution(self):
@@ -236,7 +235,7 @@ class SDistTestCase(support.TempdirManager, support.LoggingCatcher,
zip_file.close()
# making sure everything was added
- self.assertEqual(len(content), 10)
+ self.assertEqual(len(content), 9)
# checking the MANIFEST
manifest = open(join(self.tmp_dir, 'MANIFEST')).read()
@@ -362,8 +361,7 @@ class SDistTestCase(support.TempdirManager, support.LoggingCatcher,
if line.strip() != '']
finally:
f.close()
-
- self.assertEqual(len(manifest), 4)
+ self.assertEqual(len(manifest), 3)
# adding a file
self.write_file((self.tmp_dir, 'somecode', 'doc2.txt'), '#')
@@ -383,7 +381,7 @@ class SDistTestCase(support.TempdirManager, support.LoggingCatcher,
f.close()
# do we have the new file in MANIFEST ?
- self.assertEqual(len(manifest2), 5)
+ self.assertEqual(len(manifest2), 4)
self.assertIn('doc2.txt', manifest2[-1])
def test_manifest_marker(self):