From dd79c3e30c5eacfd5d89eab00e176dd370bcda5d Mon Sep 17 00:00:00 2001 From: John Sirois Date: Thu, 21 Feb 2019 20:06:27 -0800 Subject: [PATCH] Turn off pex warnings for Pants when run from a pex. --- src/python/pants/bin/pants_loader.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/python/pants/bin/pants_loader.py b/src/python/pants/bin/pants_loader.py index 83318290ca8c..4d877ed2d941 100644 --- a/src/python/pants/bin/pants_loader.py +++ b/src/python/pants/bin/pants_loader.py @@ -33,6 +33,11 @@ def setup_warnings(): # However, we do turn off deprecation warnings for libraries that Pants uses for which we do not have a fixed # upstream version, typically because the library is no longer maintained. warnings.simplefilter('default', category=DeprecationWarning) + + # If we're running from a pex, suppress pex warnings about transitive dependencies that do not + # properly declare dependencies on setuptools to support their namespace packages. + warnings.filterwarnings('ignore', category=UserWarning, module='pex') + # TODO: Future has a pending PR to fix deprecation warnings at https://github.com/PythonCharmers/python-future/pull/421. # Remove this filter once that gets merged. warnings.filterwarnings('ignore', category=DeprecationWarning, module="future")