-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.py
50 lines (43 loc) · 1.27 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
from glob import glob
from setuptools import setup, Command
import os
try:
from pybind11.setup_helpers import Pybind11Extension, build_ext
except ImportError:
from setuptools import Extension as Pybind11Extension, build_ext
__version__ = "0.5.0"
name = "jetsimpy"
ext_modules = [
Pybind11Extension(
f"{name}.jetsimpy_extension",
sorted(glob("jetsimpy/src/*.cpp") + glob("jetsimpy/src/**/*.cpp")),
define_macros = [('VERSION_INFO', __version__)],
extra_compile_args=["-O3", "-std=c++11"],
include_dirs = ["jetsimpy/src/", "jetsimpy/src/**/"]
),
]
class CleanCommand(Command):
"""Custom clean command to tidy up the project root."""
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
os.system('rm -vrf ./build ./dist ./*.pyc ./*.egg-info')
setup(
name=name,
version=__version__,
author="Hao Wang",
author_email="[email protected]",
description="Gamma-ray burst jet simulation & afterglow modeling",
packages=[name],
ext_modules=ext_modules,
python_requires=">=3.6",
install_requires=[
'numpy',
'pybind11',
],
include_package_data=True,
cmdclass={"clean": CleanCommand},
)