From c73be84d8ec6ac71dfdaa71b7943ae344f5d7cde Mon Sep 17 00:00:00 2001 From: Vinicius Monego Date: Tue, 1 Jun 2021 00:24:38 -0300 Subject: [PATCH] Use system lib_lightgbm. --- python-package/lightgbm/libpath.py | 4 ++++ python-package/setup.py | 12 ++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/python-package/lightgbm/libpath.py b/python-package/lightgbm/libpath.py index 6533792..27af2b9 100644 --- a/python-package/lightgbm/libpath.py +++ b/python-package/lightgbm/libpath.py @@ -17,8 +17,12 @@ def find_lib_path() -> List[str]: # we don't need lib_lightgbm while building docs return [] + # This variable will be set during substitution. + lib_lightgbm_path = '' + curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__))) dll_path = [curr_path, + lib_lightgbm_path, os.path.join(curr_path, '../../'), os.path.join(curr_path, 'compile'), os.path.join(curr_path, '../compile'), diff --git a/python-package/setup.py b/python-package/setup.py index ee98b1a..2f7ce38 100644 --- a/python-package/setup.py +++ b/python-package/setup.py @@ -231,7 +231,7 @@ class CustomInstall(install): self.opencl_library = None self.mpi = 0 self.hdfs = 0 - self.precompile = 0 + self.precompile = 1 self.nomp = 0 self.bit32 = 0 @@ -274,7 +274,7 @@ class CustomBdistWheel(bdist_wheel): self.opencl_library = None self.mpi = 0 self.hdfs = 0 - self.precompile = 0 + self.precompile = 1 self.nomp = 0 self.bit32 = 0 @@ -324,7 +324,10 @@ if __name__ == "__main__": copy_file(os.path.join(CURRENT_DIR, os.path.pardir, 'VERSION.txt'), os.path.join(CURRENT_DIR, 'lightgbm', 'VERSION.txt'), verbose=0) # type:ignore - version = open(os.path.join(CURRENT_DIR, 'lightgbm', 'VERSION.txt'), encoding='utf-8').read().strip() + + # This variable will be set during substitution. + version = '' + readme = open(os.path.join(CURRENT_DIR, 'README.rst'), encoding='utf-8').read() sys.path.insert(0, CURRENT_DIR) @@ -355,7 +358,8 @@ if __name__ == "__main__": zip_safe=False, cmdclass={ 'install': CustomInstall, - 'install_lib': CustomInstallLib, + # Lib will be loaded from the lightgbm package. + # 'install_lib': CustomInstallLib, 'bdist_wheel': CustomBdistWheel, 'sdist': CustomSdist, }, -- 2.31.1