From 3d3803eb1e53ff94d74d59c1aa3e6ac83e8b448f Mon Sep 17 00:00:00 2001 From: perdasilva Date: Thu, 25 Apr 2019 23:36:37 +0100 Subject: [PATCH] Updates python setup.py for recent license changes (#14778) * Updates license packing * Adds DISCLAIMER to static build licenses --- tools/pip/setup.py | 17 +++++------------ tools/staticbuild/build.sh | 1 + 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/tools/pip/setup.py b/tools/pip/setup.py index c9134d51e200..71e2549a3f19 100644 --- a/tools/pip/setup.py +++ b/tools/pip/setup.py @@ -66,12 +66,8 @@ def has_ext_modules(self): shutil.copy(LIB_PATH[0], os.path.join(CURRENT_DIR, 'mxnet')) # copy license and notice -shutil.copy(os.path.join(CURRENT_DIR, 'mxnet-build/LICENSE'), - os.path.join(CURRENT_DIR, 'mxnet/LICENSE')) -shutil.copy(os.path.join(CURRENT_DIR, 'mxnet-build/DISCLAIMER'), - os.path.join(CURRENT_DIR, 'mxnet/DISCLAIMER')) -shutil.copy(os.path.join(CURRENT_DIR, 'mxnet-build/NOTICE'), - os.path.join(CURRENT_DIR, 'mxnet/NOTICE')) +shutil.copytree(os.path.join(CURRENT_DIR, 'mxnet-build/licenses'), + os.path.join(CURRENT_DIR, 'mxnet/licenses')) # copy tools to mxnet package shutil.rmtree(os.path.join(CURRENT_DIR, 'mxnet/tools'), ignore_errors=True) @@ -154,20 +150,17 @@ def has_ext_modules(self): package_data['mxnet'].append('mxnet/libmklml_intel.so') package_data['mxnet'].append('mxnet/libiomp5.so') package_data['mxnet'].append('mxnet/libmkldnn.so.0') - shutil.copy(os.path.join(os.path.dirname(LIB_PATH[0]), '../MKLML_LICENSE'), os.path.join(CURRENT_DIR, 'mxnet')) shutil.copytree(os.path.join(CURRENT_DIR, 'mxnet-build/3rdparty/mkldnn/include'), os.path.join(CURRENT_DIR, 'mxnet/include/mkldnn')) - package_data['mxnet'].append('mxnet/MKLML_LICENSE') if platform.system() == 'Linux': shutil.copy(os.path.join(os.path.dirname(LIB_PATH[0]), 'libgfortran.so.3'), os.path.join(CURRENT_DIR, 'mxnet')) package_data['mxnet'].append('mxnet/libgfortran.so.3') shutil.copy(os.path.join(os.path.dirname(LIB_PATH[0]), 'libquadmath.so.0'), os.path.join(CURRENT_DIR, 'mxnet')) package_data['mxnet'].append('mxnet/libquadmath.so.0') -# copy licenses -if variant.startswith('CU'): - shutil.copy(os.path.join(os.path.dirname(LIB_PATH[0]), '../CUB_LICENSE'), os.path.join(CURRENT_DIR, 'mxnet')) - package_data['mxnet'].append('mxnet/CUB_LICENSE') +# Copy licenses and notice +for f in os.listdir('mxnet/licenses'): + package_data['mxnet'].append('mxnet/licenses/{}'.format(f)) from mxnet.base import _generate_op_module_signature from mxnet.ndarray.register import _generate_ndarray_function_code diff --git a/tools/staticbuild/build.sh b/tools/staticbuild/build.sh index 78b47bf4f32a..7207cf062180 100755 --- a/tools/staticbuild/build.sh +++ b/tools/staticbuild/build.sh @@ -69,6 +69,7 @@ mkdir -p licenses cp tools/dependencies/LICENSE.binary.dependencies licenses/ cp NOTICE licenses/ cp LICENSE licenses/ +cp DISCLAIMER licenses/ # Build mxnet