separate setup.py with pip installation, add trouble shooting page

This commit is contained in:
phunterlau
2015-11-01 22:11:11 -08:00
parent 9e1690defe
commit 739b3f2c5f
4 changed files with 110 additions and 24 deletions

View File

@@ -7,19 +7,6 @@ from setuptools import setup, find_packages
#import subprocess
sys.path.insert(0, '.')
#build on the fly if install in pip
#otherwise, use build.sh in the parent directory
#ugly solution since pip version transition and the old pip detection method not
#working. Manually turn on when packing up for pip installation
if False:
if not os.name == 'nt': #if not windows
os.system('sh ./xgboost/build-python.sh')
else:
print('Windows users please use github installation.')
sys.exit()
CURRENT_DIR = os.path.dirname(__file__)
# We can not import `xgboost.libpath` in setup.py directly since xgboost/__init__.py
@@ -31,10 +18,8 @@ exec(compile(open(libpath_py, "rb").read(), libpath_py, 'exec'), libpath, libpat
LIB_PATH = libpath['find_lib_path']()
#to deploy to pip, please use
#make pythonpack
#python setup.py register sdist upload
#and be sure to test it firstly using "python setup.py register sdist upload -r pypitest"
#Please use setup_pip.py for generating and deploying pip installation
#detailed instruction in setup_pip.py
setup(name='xgboost',
version=open(os.path.join(CURRENT_DIR, 'xgboost/VERSION')).read().strip(),
#version='0.4a23',
@@ -47,14 +32,8 @@ setup(name='xgboost',
maintainer_email='phunter.lau@gmail.com',
zip_safe=False,
packages=find_packages(),
#don't need this and don't use this, give everything to MANIFEST.in
#package_dir = {'':'xgboost'},
#package_data = {'': ['*.txt','*.md','*.sh'],
# }
#this will use MANIFEST.in during install where we specify additional files,
#this is the golden line
include_package_data=True,
#!!! don't use data_files, otherwise install_data process will copy it to
#root directory for some machines, and cause confusions on building
data_files=[('xgboost', LIB_PATH)],
url='https://github.com/dmlc/xgboost')