"Please don't use 'module' as suffix in `name` argument, "
"it will be stripped in setuptools.bdist_egg and cause import error."
ext_modules=attr.get('ext_modules',[])
ext_modules=attr.get('ext_modules',[])
ifnotisinstance(ext_modules,list):
ifnotisinstance(ext_modules,list):
ext_modules=[ext_modules]
ext_modules=[ext_modules]
assertlen(
assertlen(
ext_modules
ext_modules
)==1,"Required only one Extension, but received {}. If you want to compile multi operators, you can include all necessary source files in one Extenion.".format(
)==1,"Required only one Extension, but received {}. If you want to compile multi operators, you can include all necessary source files in one Extension.".format(
len(ext_modules))
len(ext_modules))
# replace Extension.name with attr['name] to keep consistant with Package name.
# replace Extension.name with attr['name] to keep consistant with Package name.
forext_moduleinext_modules:
forext_moduleinext_modules:
...
@@ -94,6 +175,13 @@ def setup(**attr):
...
@@ -94,6 +175,13 @@ def setup(**attr):
assert'easy_install'notincmdclass
assert'easy_install'notincmdclass
cmdclass['easy_install']=EasyInstallCommand
cmdclass['easy_install']=EasyInstallCommand
# Note(Aurelius84): Add rename build_base directory hook in build command.
# To avoid using same build directory that will lead to remove the directory
# by mistake while parallelling execute setup.py, for example on CI.