-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
71 lines (53 loc) · 2.22 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
66
67
68
69
70
71
import glob
import os
from pathlib import Path
from setuptools import setup
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, "hybrid", "version.py"), encoding="utf-8") as f:
version = f.read()
version = version.split('=')[-1].strip().strip('"').strip("'")
# copy over packages
directories = ['hybrid', "tools", 'alt_dev']
pkg_dirs = []
def recursive_directories(dirs):
for directory in dirs:
pkg_dirs.append(directory)
files = glob.glob(directory + '/*')
for f in files:
if os.path.isdir(f):
recursive_directories((f,))
recursive_directories(directories)
# copy over package data
package_data = {"tools": [str(Path("analysis") / "bos" / "BOSLookup.csv")],
"hybrid": []}
hybrid_path = Path("hybrid")
flicker_path = hybrid_path / "layout" / "flicker_data"
for file in glob.glob(str(flicker_path / "*shadow.txt")):
package_data["hybrid"].append(str(os.path.relpath(file, str(Path("hybrid")))))
for file in glob.glob(str(flicker_path / "*flicker.txt")):
package_data["hybrid"].append(str(os.path.relpath(file, str(Path("hybrid")))))
pySSC_daotk_path = hybrid_path / "pySSC_daotk"
pySSC_data_dirs = ["libs", "tower_data", "trough_data"]
for data_dir in pySSC_data_dirs:
data_path = pySSC_daotk_path / data_dir
for file in glob.glob(str(data_path / '*')):
package_data["hybrid"].append(str(os.path.relpath(file, str(Path("hybrid")))))
cbc_solver_path = hybrid_path / "dispatch" / "cbc_solver" / "cbc-win64"
for file in glob.glob(str(cbc_solver_path / '*')):
package_data["hybrid"].append(str(os.path.relpath(file, str(Path("hybrid")))))
setup(name='HOPP',
version=version,
url='https://www.https://github.com/NREL/HOPP',
description='Hybrid Systems Optimization and Performance Platform',
long_description=open("RELEASE.md").read(),
long_description_content_type='text/markdown',
license='BSD 3-Clause',
author='NREL',
author_email='dguittet@nrel.gov',
python_requires='>=3.7',
packages=pkg_dirs,
package_data=package_data,
include_package_data=True,
install_requires=open("requirements.txt").readlines(),
tests_require=['pytest']
)