Skip to content

Commit

Permalink
Update setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
akaszynski authored Feb 29, 2024
1 parent b1a559a commit 9497cca
Showing 1 changed file with 25 additions and 72 deletions.
97 changes: 25 additions & 72 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,80 +1,33 @@
"""Setup for pytetwild."""
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
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand

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}")


# 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")
try:
from skbuild import setup
except ImportError:
print("Please update pip to pip 10 or greater, or a manually install the PEP 518 requirements in pyproject.toml", file=sys.stderr)
raise

cmake_args = []
debug = False
cfg = 'Debug' if debug else 'Release'

setup(
name="pytetwild",
packages=["pytetwild"],
version=__version__,
description="Tetrahedralize surfaces using fTetWild",
long_description=open(readme_file).read(),
long_description_content_type="text/x-rst",
author="PyVista Developers",
author_email="[email protected]",
license="MPLv2",
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",
"Programming Language :: Python :: 3.12",
],
python_requires=">=3.8",
url="https://github.com/pyvista/pytetwild",
# Build cython modules
ext_modules=cythonize(
[
Extension(
"pytetwild._wrapper",
[
"pytetwild/src/FTetWildWrapper.cpp",
"pytetwild/_wrapper.pyx",
"pytetwild/fTetWild/src.cpp",
],
language="c++",
extra_compile_args=extra_compile_args,
define_macros=macros,
include_dirs=[np.get_include()],
)
]
),
package_data={
"pytetwild": ["*.pyx", "*.hpp"],
"pytetwild/wrapper": ["*.c", "*.h"],
},
keywords="tetrahedralize tetwild ftetwild",
install_requires=["numpy>1.11.0"],
name='pytetwild',
version='0.1.dev0',
author='Alex Kaszynski',
author_email='[email protected]',
description='Python wrapper of fTetWild',
long_description=open("README.rst").read(),
long_description_content_type="text/rst",
packages=find_packages('src'),
package_dir={'':'src'},
zip_safe=False,
include_package_data=False,
cmake_args=cmake_args,
cmake_install_dir="src/",
cmake_install_target='install',
install_requires="numpy",
)

0 comments on commit 9497cca

Please sign in to comment.