Skip to content

Commit

Permalink
Updates python setup.py for recent license changes (apache#14778)
Browse files Browse the repository at this point in the history
* Updates license packing

* Adds DISCLAIMER to static build licenses
  • Loading branch information
perdasilva authored and haohuw committed Jun 23, 2019
1 parent 5c7dd6a commit b7f7f69
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
17 changes: 5 additions & 12 deletions tools/pip/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tools/staticbuild/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b7f7f69

Please sign in to comment.