Commit aa99c40a authored by Tsukasa OMOTO's avatar Tsukasa OMOTO Committed by Guolin Ke
Browse files

python-package: fix version (#832)

* python-package: fix version

* remove version variable
parent 256547fa
...@@ -20,11 +20,11 @@ try: ...@@ -20,11 +20,11 @@ try:
except ImportError: except ImportError:
pass pass
version = '2.0.1'
if os.path.isfile('./VERSION.txt'):
version = open('./VERSION.txt').read().strip()
__version__ = version dir_path = os.path.dirname(os.path.realpath(__file__))
if os.path.isfile(os.path.join(dir_path, 'VERSION.txt')):
__version__ = open(os.path.join(dir_path, 'VERSION.txt')).read().strip()
__all__ = ['Dataset', 'Booster', __all__ = ['Dataset', 'Booster',
'train', 'cv', 'train', 'cv',
......
...@@ -143,14 +143,17 @@ class CustomSdist(sdist): ...@@ -143,14 +143,17 @@ class CustomSdist(sdist):
if __name__ == "__main__": if __name__ == "__main__":
if (8 * struct.calcsize("P")) != 64: if (8 * struct.calcsize("P")) != 64:
raise Exception('Cannot install LightGBM in 32-bit python, please use 64-bit python instead.') raise Exception('Cannot install LightGBM in 32-bit python, please use 64-bit python instead.')
if os.path.isfile('../VERSION.txt'):
distutils.file_util.copy_file("../VERSION.txt", "./lightgbm/") dir_path = os.path.dirname(os.path.realpath(__file__))
version = '2.0.3' if os.path.isfile(os.path.join('..', 'VERSION.txt')):
if os.path.isfile('./lightgbm/VERSION.txt'): distutils.file_util.copy_file(
with open('./lightgbm/VERSION.txt') as file_version: os.path.join('..', 'VERSION.txt'),
version = file_version.readline().strip() os.path.join('.', 'lightgbm'))
if os.path.isfile(os.path.join(dir_path, 'lightgbm', 'VERSION.txt')):
version = open(os.path.join(dir_path, 'lightgbm', 'VERSION.txt')).read().strip()
sys.path.insert(0, '.') sys.path.insert(0, '.')
data_files = []
setup(name='lightgbm', setup(name='lightgbm',
version=version, version=version,
description='LightGBM Python Package', description='LightGBM Python Package',
...@@ -169,6 +172,6 @@ if __name__ == "__main__": ...@@ -169,6 +172,6 @@ if __name__ == "__main__":
}, },
packages=find_packages(), packages=find_packages(),
include_package_data=True, include_package_data=True,
data_files=data_files, data_files=[],
license='The MIT License (Microsoft)', license='The MIT License (Microsoft)',
url='https://github.com/Microsoft/LightGBM') url='https://github.com/Microsoft/LightGBM')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment