diff --git a/python-package/setup_pip.py b/python-package/setup_pip.py index f5e475bb5..1eac43702 100644 --- a/python-package/setup_pip.py +++ b/python-package/setup_pip.py @@ -3,7 +3,7 @@ from __future__ import absolute_import import sys import os -from setuptools import setup, find_packages +from setuptools import setup, find_packages, Distribution # import subprocess sys.path.insert(0, '.') @@ -19,6 +19,14 @@ else: CURRENT_DIR = os.path.dirname(__file__) + +class BinaryDistribution(Distribution): + """Auxilliary class necessary to inform setuptools that this is a + non-generic, platform-specific package.""" + def has_ext_modules(self): + return True + + # We can not import `xgboost.libpath` in setup.py directly since xgboost/__init__.py # import `xgboost.core` and finally will import `numpy` and `scipy` which are setup # `install_requires`. That's why we're using `exec` here. @@ -55,4 +63,5 @@ setup(name='xgboost', # otherwise install_data process will copy it to # root directory for some machines, and cause confusions on building # data_files=[('xgboost', LIB_PATH)], + distclass=BinaryDistribution, url='https://github.com/dmlc/xgboost')