-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathsetup.py
71 lines (64 loc) · 2.8 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
from setuptools import setup, Command, find_packages
from distutils.extension import Extension
import numpy as np
from Cython.Build import cythonize
import os
import re
import ast
class CleanCommand(Command):
"""Custom clean command to tidy up the project root."""
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
os.system('rm -vrf build dist *.pyc *.tgz python/*.egg-info')
# add cython code to the pumapy extensions
extensions = cythonize([
Extension("pumapy.generation.tpms_utils", [os.path.join("python", "pumapy", "generation", "tpms_utils.pyx")]),
Extension("pumapy.physics_models.finite_volume.isotropic_conductivity_utils", [os.path.join("python", "pumapy", "physics_models", "finite_volume", "isotropic_conductivity_utils.pyx")]),
Extension("pumapy.physics_models.finite_volume.anisotropic_conductivity_utils", [os.path.join("python", "pumapy", "physics_models", "finite_volume", "anisotropic_conductivity_utils.pyx")]),
Extension("pumapy.physics_models.finite_volume.elasticity_utils", [os.path.join("python", "pumapy", "physics_models", "finite_volume", "elasticity_utils.pyx")]),
])
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
# automatically update version according to __init__.py
_version_re = re.compile(r'__version__\s+=\s+(.*)')
with open('python/pumapy/__init__.py', 'rb') as f:
version = str(ast.literal_eval(_version_re.search(
f.read().decode('utf-8')).group(1)))
setup(
name="pumapy",
version=version,
author="PuMA team",
maintainer_email="[email protected], [email protected]",
description="A package to compute material properties from micro-CT data.",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/nasa/puma",
project_urls={
"Bug Tracker": "https://github.com/nasa/puma/issues",
},
platforms=["Linux", "Mac", "Windows"],
package_dir={"": "python"},
packages=find_packages(where="python"),
ext_modules=extensions,
cmdclass={'clean': CleanCommand},
install_requires=[ # TexGen also required, but it can be installed as add-on
"numpy",
"scikit-image >=0.17", # in order to have marching_cubes in the API
"scipy ~=1.11", # to avoid change in API
"matplotlib",
"pyvista",
],
package_data={'': [os.path.join('data', '*')]}, # copy over all the example data
classifiers=[
'Development Status :: 5 - Production/Stable',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Physics',
],
include_dirs=[np.get_include()]
)