-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
84 lines (74 loc) · 2.35 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
77
78
79
80
81
82
83
84
"""Setup for pyminiply."""
from io import open as io_open
import os
import sys
from Cython.Build import cythonize
import numpy as np
from setuptools import Extension, setup
filepath = os.path.dirname(__file__)
# Define macros for cython
macros = []
if os.name == "nt": # windows
extra_compile_args = ["/O2", "/w", "/GS"]
elif os.name == "posix": # linux org mac os
if sys.platform == "linux":
extra_compile_args = ["-std=gnu++11", "-O3", "-w"]
else: # probably mac os
extra_compile_args = ["-std=c++11", "-O3", "-w"]
else:
raise Exception(f"Unsupported OS {os.name}")
# Check if 64-bit
if sys.maxsize > 2**32:
macros.append(("IS64BITPLATFORM", None))
# Get version from version info
__version__ = None
version_file = os.path.join(filepath, "pyminiply", "_version.py")
with io_open(version_file, mode="r") as fd:
exec(fd.read())
# readme file
readme_file = os.path.join(filepath, "README.rst")
setup(
name="pyminiply",
packages=["pyminiply"],
version=__version__,
description="Read in PLY files using a wrapper over miniply",
long_description=open(readme_file).read(),
long_description_content_type="text/x-rst",
author="PyVista Developers",
author_email="info@pyvista.org",
license="MIT",
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
],
python_requires=">=3.8",
url="https://github.com/pyvista/pyminiply",
# Build cython modules
ext_modules=cythonize(
[
Extension(
"pyminiply._wrapper",
[
"pyminiply/wrapper.cpp",
"pyminiply/_wrapper.pyx",
"pyminiply/miniply/miniply.cpp",
],
language="c++",
extra_compile_args=extra_compile_args,
define_macros=macros,
include_dirs=[np.get_include()],
)
]
),
package_data={
"pyminiply": ["*.pyx", "*.hpp"],
"pyminiply/wrapper": ["*.c", "*.h"],
},
keywords="read ply",
install_requires=["numpy>1.11.0"],
)