forked from poine/pysbpl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·64 lines (54 loc) · 1.78 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
"""
Build pysbpl
By: Poine, Schmittle
"""
import distutils
import io
import Cython
import setuptools
from Cython.Distutils import build_ext
class my_build_ext(Cython.Distutils.build_ext):
"""Build extensions for C++"""
def build_extensions(self):
"""Build extensions"""
distutils.sysconfig.customize_compiler(self.compiler)
try:
self.compiler.compiler_so.remove("-Wstrict-prototypes")
except (AttributeError, ValueError):
pass
build_ext.build_extensions(self)
##
# extra_compile_args=["-std=c++11", "-Wno-cpp"] is for removing the deprecation warning
# because defining NPY_NO_DEPRECATED_API to NPY_1_7_API_VERSION breaks compilation
ext = setuptools.Extension(
"pysbpl.sbpl", # name of extension
["pysbpl/sbpl.pyx"], # filename of our Pyrex/Cython source
language="c++", # this causes Pyrex/Cython to create C++ source
include_dirs=[],
extra_compile_args=["-std=c++11", "-Wno-cpp"],
libraries=["sbpl"],
library_dirs=[],
runtime_library_dirs=[],
)
with io.open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="pysbpl",
ext_modules=[ext],
cmdclass={"build_ext": my_build_ext},
version="0.0.1",
author="Edited by: Matt Schmittle",
author_email="[email protected]",
description="Python bindings for SBPL",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/schmittlema/pysbpl",
packages=setuptools.find_packages(),
include_package_data=True,
classifiers=[
"Programming Language :: Python :: 2/3",
"License :: OSI Approved :: BSD3 License",
"Operating System :: OS Independent",
],
python_requires=">=2",
)