From 3e831b6083bc179264d4945b78726179fa943376 Mon Sep 17 00:00:00 2001 From: Tao Luo Date: Wed, 16 Oct 2019 11:14:53 +0800 Subject: [PATCH] reduce setup.py.in installation logs (#20641) test=develop --- python/setup.py.in | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/python/setup.py.in b/python/setup.py.in index e0bfd72fac5..6a97d65d3c1 100644 --- a/python/setup.py.in +++ b/python/setup.py.in @@ -351,6 +351,14 @@ class InstallHeaders(Command): def get_outputs(self): return self.outfiles +# Saving the installation log generated from setup.py to log_file. +# The log_file is ${PADDLE_BINARY_DIR}/python/setup.py.log. +stdout = sys.stdout +stderr = sys.stderr +log_file = open('setup.py.log', 'w') +sys.stdout = log_file +sys.stderr = log_file + setup(name='${PACKAGE_NAME}', version='${PADDLE_VERSION}', description='Parallel Distributed Deep Learning', @@ -367,3 +375,12 @@ setup(name='${PACKAGE_NAME}', 'install': InstallCommand, } ) + +log_file.close() +# Revert back the stdout/stderr to their default references. +sys.stdout = stdout +sys.stderr = stderr +# As there are a lot of files in purelib which causes many logs, +# we don't print them on the screen, and you can open `setup.py.log` +# for the full logs. +os.system('grep -v "purelib" setup.py.log') -- GitLab