-
Notifications
You must be signed in to change notification settings - Fork 29
/
setup.py
100 lines (89 loc) · 3.29 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
"""Setup for pymeshfix."""
import os
import sys
from io import open as io_open
import numpy as np
from Cython.Build import cythonize
from setuptools import Extension, setup
filepath = os.path.dirname(__file__)
# Define macros for cython
macros = []
if os.name == "nt": # windows
extra_compile_args = ["/openmp", "/O2", "/w", "/GS"]
extra_link_args = []
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 = ["-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, "pymeshfix", "_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="pymeshfix",
packages=["pymeshfix", "pymeshfix/examples"],
version=__version__,
description="Repair triangular meshes using MeshFix",
long_description=open(readme_file).read(),
long_description_content_type="text/x-rst",
author="PyVista Developers",
author_email="[email protected]",
license="GPLv3",
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
],
python_requires=">=3.9",
url="https://github.com/pyvista/pymeshfix",
# Build cython modules
ext_modules=cythonize(
[
Extension(
"pymeshfix._meshfix",
[
"pymeshfix/cython/meshfix.cpp",
"pymeshfix/cython/tin.cpp",
"pymeshfix/cython/checkAndRepair.cpp",
"pymeshfix/cython/coordinates.cpp",
"pymeshfix/cython/detectIntersections.cpp",
"pymeshfix/cython/edge.cpp",
"pymeshfix/cython/graph.cpp",
"pymeshfix/cython/heap.cpp",
"pymeshfix/cython/holeFilling.cpp",
"pymeshfix/cython/io.cpp",
"pymeshfix/cython/jqsort.cpp",
"pymeshfix/cython/list.cpp",
"pymeshfix/cython/marchIntersections.cpp",
"pymeshfix/cython/matrix.cpp",
"pymeshfix/cython/orientation.c",
"pymeshfix/cython/point.cpp",
"pymeshfix/cython/tmesh.cpp",
"pymeshfix/cython/triangle.cpp",
"pymeshfix/cython/vertex.cpp",
"pymeshfix/cython/_meshfix.pyx",
],
language="c++",
extra_compile_args=extra_compile_args,
define_macros=macros,
include_dirs=[np.get_include()],
)
]
),
keywords="meshfix",
package_data={"pymeshfix/examples": ["StanfordBunny.ply", "planar_mesh.ply"]},
install_requires=["numpy>1.11.0", "pyvista>=0.30.0"],
)