aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2016-12-01 11:06:57 -0500
committerJason R. Coombs <jaraco@jaraco.com>2016-12-01 11:06:57 -0500
commit09f0ed4036de064e3807801668d5875a9a7e8b9d (patch)
tree0dce90f560de89003b260e59a80373ca0b311942
parentb47fe15b9039a165589353a1a43f6dfe3bbe3a8e (diff)
parentd2287000895d403fd50c8c5777e9c67f22268d8b (diff)
downloadexternal_python_setuptools-09f0ed4036de064e3807801668d5875a9a7e8b9d.tar.gz
external_python_setuptools-09f0ed4036de064e3807801668d5875a9a7e8b9d.tar.bz2
external_python_setuptools-09f0ed4036de064e3807801668d5875a9a7e8b9d.zip
Merge pull request #840.
-rw-r--r--CHANGES.rst1
-rwxr-xr-xsetuptools/command/egg_info.py11
-rw-r--r--setuptools/tests/test_egg_info.py11
3 files changed, 20 insertions, 3 deletions
diff --git a/CHANGES.rst b/CHANGES.rst
index e6fa0d66..16cc06be 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -7,6 +7,7 @@ v30.0.0
* #864: Drop support for Python 3.2. Systems requiring
Python 3.2 support must use 'setuptools < 30'.
+* #825: Suppress warnings for single files.
v29.0.1
-------
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py
index 6cc8f4c4..6f8fd874 100755
--- a/setuptools/command/egg_info.py
+++ b/setuptools/command/egg_info.py
@@ -554,10 +554,17 @@ class manifest_maker(sdist):
msg = "writing manifest file '%s'" % self.manifest
self.execute(write_file, (self.manifest, files), msg)
- def warn(self, msg): # suppress missing-file warnings from sdist
- if not msg.startswith("standard file not found:"):
+ def warn(self, msg):
+ if not self._should_suppress_warning(msg):
sdist.warn(self, msg)
+ @staticmethod
+ def _should_suppress_warning(msg):
+ """
+ suppress missing-file warnings from sdist
+ """
+ return re.match(r"standard file .*not found", msg)
+
def add_defaults(self):
sdist.add_defaults(self)
self.filelist.append(self.template)
diff --git a/setuptools/tests/test_egg_info.py b/setuptools/tests/test_egg_info.py
index 12c10497..dc41bc1f 100644
--- a/setuptools/tests/test_egg_info.py
+++ b/setuptools/tests/test_egg_info.py
@@ -4,7 +4,7 @@ import re
import stat
import sys
-from setuptools.command.egg_info import egg_info
+from setuptools.command.egg_info import egg_info, manifest_maker
from setuptools.dist import Distribution
from setuptools.extern.six.moves import map
@@ -237,6 +237,15 @@ class TestEggInfo(object):
pkginfo = os.path.join(egg_info_dir, 'PKG-INFO')
assert 'Requires-Python: >=1.2.3' in open(pkginfo).read().split('\n')
+ def test_manifest_maker_warning_suppresion(self):
+ fixtures = [
+ "standard file not found: should have one of foo.py, bar.py",
+ "standard file 'setup.py' not found"
+ ]
+
+ for msg in fixtures:
+ assert manifest_maker._should_suppress_warning(msg)
+
def _run_install_command(self, tmpdir_cwd, env, cmd=None, output=None):
environ = os.environ.copy().update(
HOME=env.paths['home'],