-
Notifications
You must be signed in to change notification settings - Fork 11
/
setup.py
97 lines (86 loc) · 3.12 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
from setuptools import find_packages, setup
import os
import sys
from configparser import ConfigParser
def gen_data_files(*dirs):
"""Creates the list of files (not necessarily python files) that need to be
installed together with the rest of stuff"""
results = []
exclude = [".DS_Store", "__pycache__", "egg", ".git"]
for src_dir in dirs:
for root, dirs, files in os.walk(src_dir):
if not any(sub in root for sub in exclude):
results.append(
(root, [os.path.join(root, f) for f in files if f not in exclude])
)
return results
here = os.path.abspath(os.path.dirname(__file__))
default_config = os.path.join(here, "rayflare", "rayflare_config.txt")
config = ConfigParser()
config.read([default_config])
# Option for updating the manifest
if "update_manifest" in sys.argv:
# Update the MANIFEST.in file with all the data from within solcore
include = "rayflare"
exclude = ["__pycache__", "egg", "darwin", "cpython"]
with open("MANIFEST.in", "w", encoding="utf-8") as f:
for root, dirs, files in os.walk("."):
if not any(sub in root for sub in exclude) and root[2:9] == include:
try:
files.remove(".DS_Store")
except ValueError:
pass
for file in files:
if any(sub in file for sub in exclude):
continue
include_line = "include " + os.path.join(root[2:], file) + "\n"
f.write(include_line)
sys.exit()
# Get the long description from the README file
with open(os.path.join(here, "README.md"), encoding="utf-8") as f:
long_description = f.read()
install_requires = [
"matplotlib",
"scipy",
"numpy",
"solcore",
"xarray",
"sparse",
"joblib",
"seaborn",
]
setup(
name="rayflare",
version="1.2.0",
description="Python-based integrated optical modelling",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/qpv-research-group/rayflare",
project_urls={
"Documentation": "http://rayflare.readthedocs.io",
},
author="Phoebe Pearce",
author_email="phoebe.pearce15@imperial.ac.uk",
license="GNU GPLv3",
python_requires=">=3.6",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"License :: OSI Approved",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Physics",
],
keywords="photovoltaics modelling physics optics",
packages=find_packages(exclude=[]),
package_data={"": ["*.*"]},
include_package_data=True,
setup_requires="pytest-runner",
install_requires=install_requires,
# tests_require=tests_require,
# extras_require=extras_require,
)