-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
50 lines (40 loc) · 1.15 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
import os
from setuptools import setup, Extension
NAME = "noisepy"
VERSION = "1.2.0"
DESCR = "Convert audio feed into noise indicators"
URL = "http://noise-planet.org"
REQUIRES = []
AUTHOR = "Nicolas Fortin"
EMAIL = "nicolas.fortin -at- ifsttar.fr"
LICENSE = "BSD3"
SRC_DIR = "noisepy"
PACKAGES = [SRC_DIR]
try:
import Cython
USE_CYTHON = True
except ImportError as e:
USE_CYTHON = False
ext = ".pyx" if USE_CYTHON else ".c"
ext_1 = Extension(SRC_DIR + ".wrapped",
["core/src/acoustic_indicators.c","core/src/kiss_fft.c","core/src/kiss_fftr.c", SRC_DIR + "/noisepy" + ext],
libraries=[],
include_dirs=["core/include"])
EXTENSIONS = [ext_1]
if USE_CYTHON:
from Cython.Build import cythonize
EXTENSIONS = cythonize(EXTENSIONS)
if __name__ == "__main__":
setup(install_requires=REQUIRES,
packages=PACKAGES,
zip_safe=False,
name=NAME,
version=VERSION,
description=DESCR,
author=AUTHOR,
author_email=EMAIL,
url=URL,
license=LICENSE,
test_suite="tests",
ext_modules=EXTENSIONS
)