-
Notifications
You must be signed in to change notification settings - Fork 11
/
setup.py
65 lines (57 loc) · 1.94 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
"""
Setup file for the Distributed Optimal and Predictive Energy Resources.
"""
import os
import sys
import json
import setuptools
import subprocess as sp
root = os.path.dirname(os.path.abspath(__file__))
INSTALL_SOLVERS = True
# description
with open('README.md', 'r', encoding='utf8') as f:
long_description = f.read()
# requirements
with open('requirements.txt', 'r', encoding='utf8') as f:
install_requires = f.read().splitlines()
# version
with open('doper/__init__.py', 'r', encoding='utf8') as f:
version = json.loads(f.read().split('__version__ = ')[1].split('\n')[0])
# setup solvers
if INSTALL_SOLVERS:
print('Installing Solvers...')
if not 'win' in sys.platform:
sp.call('sh setup_solvers.sh', shell=True, cwd=os.path.join(root, 'doper', 'solvers'))
else:
sp.call('setup_solvers.bat', shell=True, cwd=os.path.join(root, 'doper', 'solvers'))
print('done.')
setuptools.setup(
name="DOPER",
version=version,
author="Gehbauer, Christoph",
description="Distributed Optimal and Predictive Energy Resources",
long_description=long_description,
long_description_content_type="text/markdown",
license_files = ['license.txt'],
url="https://github.com/LBNL-ETA/DOPER",
project_urls={
"Bug Tracker": "https://github.com/LBNL-ETA/DOPER/issues",
},
classifiers=[
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
],
packages=['doper'],
package_data={'': ['*.txt.', '*.md'],
'doper': ['models/*',
'solvers/*',
'solvers/Linux64/*',
'solvers/Windows64/*',
'data/*',
'examples/*',
'resources/*',
'resources/pvlib/*']},
include_package_data=True,
python_requires=">=3.6",
install_requires=install_requires
)