From c972feb4b503b0537ca41e7d7f170a8ecebca70d Mon Sep 17 00:00:00 2001 From: Skipper Seabold Date: Wed, 8 Apr 2015 14:07:37 -0500 Subject: [PATCH] Make Python package installable. --- wrapper/__init__.py | 0 wrapper/setup.py | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 wrapper/__init__.py create mode 100644 wrapper/setup.py diff --git a/wrapper/__init__.py b/wrapper/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/wrapper/setup.py b/wrapper/setup.py new file mode 100644 index 000000000..49b1a7872 --- /dev/null +++ b/wrapper/setup.py @@ -0,0 +1,28 @@ +import os + +from setuptools import setup + + +class XGBoostLibraryNotFound(Exception): + pass + + +cur_dir = os.path.dirname(os.path.abspath(__file__)) + +if os.name == 'nt': + dll_path = os.path.join(cur_dir, + '../windows/x64/Release/xgboost_wrapper.dll') +else: + dll_path = os.path.join(cur_dir, 'libxgboostwrapper.so') + +if not os.path.exists(dll_path): + raise XGBoostLibraryNotFound("XGBoost library not found. Did you run " + "../make?") + +setup(name="xgboost", + version="0.32", + description="Python wrappers for XGBoost: eXtreme Gradient Boosting", + zip_safe=False, + py_modules=['xgboost'], + data_files=[dll_path], + url="https://github.com/dmlc/xgboost")