forked from sadaszewski/concaveman-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·76 lines (63 loc) · 2.59 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
#!/usr/bin/env python
from setuptools import setup, Extension
from Cython.Build import cythonize
import os
import numpy as np # For the include directory.
from pathlib import Path
rootpath = Path(__file__).parent.resolve()
long_description = open(rootpath / 'README.md').read()
include_dirs = [np.get_include(),
str(rootpath / 'src' / 'cpp')]
# # Need the stdint header for Windows (VS2008).
# if sys.platform.startswith('win') and sys.version_info.major <= 2:
# include_dirs.append(os.path.join('rootpath', 'src', 'win_headers'))
ext_modules = cythonize([Extension("concaveman.build_hull",
["src/concaveman/build_hull.pyx",
"src/cpp/concaveman.cpp"],
include_dirs=include_dirs,
language="c++",
# this work on the mac, should work in Linux
# for Windows: who knows?
extra_compile_args=['-std=c++11'],
)])
def extract_version():
fname = os.path.join(rootpath, 'src', 'concaveman', '__init__.py')
with open(fname) as f:
for line in f:
if (line.startswith('__version__')):
version = line.split('=')[1].strip().strip('"')
break
else:
raise ValueError("Couldn't find __version__ in %s" % fname)
return version
setup(
name="concaveman",
version=extract_version(),
description="Python wrappers around a C++ concave hull Implementation",
long_description=long_description,
author="s.adaszewski, Christopher H. Barker",
author_email="Chris.Barker@noaa.gov",
url="https://github.com/NOAA-ORR-ERD",
license="BSD",
# keywords = "",
ext_modules=ext_modules,
packages=["concaveman", "concaveman/tests"],
package_dir={'': 'src'},
install_requires=['numpy', 'scipy'],
setup_requires=['cython>0.29'],
tests_require=['pytest'],
classifiers=[
"Development Status :: 4 - Beta",
"License :: Public Domain",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
"Programming Language :: C++",
"Programming Language :: Cython",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Utilities",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Visualization",
],
)