forked from rpoleski/MulensModel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
60 lines (53 loc) · 1.91 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
from pathlib import Path
import platform
from setuptools import Extension, find_packages, setup
PROJECT_PATH = Path(__file__).resolve().parent
SOURCE_PATH = PROJECT_PATH / "source"
DATA_PATH = PROJECT_PATH / "data"
file_required = PROJECT_PATH / "requirements.txt"
with file_required.open() as file_:
install_requires = file_.read().splitlines()
data_files = [
(
str(file_required.relative_to(PROJECT_PATH)),
[str(file_required.relative_to(PROJECT_PATH))],
)
]
version = "unknown"
with Path(SOURCE_PATH / "MulensModel" / "version.py").open() as in_put:
for line_ in in_put.readlines():
if line_.startswith('__version__'):
version = line_.split()[2][1:-1]
source_VBBL = SOURCE_PATH / "VBBL"
source_AC = SOURCE_PATH / "AdaptiveContouring"
source_MM = SOURCE_PATH / "MulensModel"
source_MMmo = source_MM / "mulensobjects"
# C/C++ Extensions
kwargs = dict()
if platform.system().upper() != "WINDOWS":
kwargs['libraries'] = ["m"]
ext_AC = Extension(
"MulensModel.AdaptiveContouring", **kwargs,
sources=[str(f.relative_to(PROJECT_PATH)) for f in source_AC.glob("*.c")])
ext_VBBL = Extension(
"MulensModel.VBBL", **kwargs,
sources=[
str(f.relative_to(PROJECT_PATH)) for f in source_VBBL.glob("*.cpp")])
setup(
name='MulensModel',
version=version,
url='https://github.com/rpoleski/MulensModel',
project_urls={
'documentation': 'https://github.com/rpoleski/MulensModel'},
ext_modules=[ext_AC, ext_VBBL],
author='Radek Poleski & Jennifer Yee',
author_email='[email protected]',
description='package for modeling gravitational microlensing events',
long_description='package for modeling gravitational microlensing events',
packages=find_packages(where="source"),
package_dir={"": "source"},
include_package_data=True,
data_files=data_files,
python_requires=">=3.6",
install_requires=install_requires,
)