-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathsetup.py
More file actions
94 lines (80 loc) · 2.75 KB
/
Copy pathsetup.py
File metadata and controls
94 lines (80 loc) · 2.75 KB
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
from setuptools import find_packages, setup
from torch.utils.cpp_extension import CUDAExtension, BuildExtension
import os
import glob
root_path = os.path.dirname(__file__)
version: dict = dict()
with open("./nesvor/version.py") as fp:
exec(fp.read(), version)
def get_long_description():
if not os.path.exists("README.md"):
return ""
with open("README.md", "r") as fh:
long_description = fh.read()
return long_description
def get_extensions():
extensions = [
CUDAExtension(
name="nesvor.slice_acq_cuda",
sources=[
os.path.join(
root_path, "nesvor", "slice_acquisition", "slice_acq_cuda.cpp"
),
os.path.join(
root_path, "nesvor", "slice_acquisition", "slice_acq_cuda_kernel.cu"
),
],
),
CUDAExtension(
name="nesvor.transform_convert_cuda",
sources=[
os.path.join(
root_path, "nesvor", "transform", "transform_convert_cuda.cpp"
),
os.path.join(
root_path, "nesvor", "transform", "transform_convert_cuda_kernel.cu"
),
],
),
]
return extensions
def get_package_data():
ext_src = []
for ext in ["cpp", "cu", "h", "cuh"]:
ext_src.extend(
glob.glob(os.path.join("nesvor", "**", f"*.{ext}"), recursive=True)
)
return {"nesvor": ["py.typed"] + [os.path.join("..", path) for path in ext_src]}
def get_entry_points():
entry_points = {
"console_scripts": ["nesvor=nesvor.cli.main:main"],
}
return entry_points
setup(
name="nesvor",
packages=find_packages(exclude=("tests",)),
version=version["__version__"],
description="NeSVoR: toolkit for neural slice-to-volume reconstruction",
long_description=get_long_description(),
long_description_content_type="text/markdown",
url=version["__url__"],
author=version["__author__"],
author_email=version["__email__"],
license="MIT",
zip_safe=False,
entry_points=get_entry_points(),
ext_modules=get_extensions(),
package_data=get_package_data(),
cmdclass={"build_ext": BuildExtension},
classifiers=[
"Intended Audience :: Healthcare Industry",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Topic :: Scientific/Engineering :: Medical Science Apps.",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Image Processing",
"Environment :: GPU :: NVIDIA CUDA",
"Programming Language :: Python :: 3",
"Programming Language :: C++",
],
)