forked from rapidsai/ucx-py
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
109 lines (94 loc) · 3.08 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
101
102
103
104
105
106
107
108
109
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
# See file LICENSE for terms.
# This file is a copy of what is available in a Cython demo + some additions
from __future__ import absolute_import, print_function
import os
from distutils.sysconfig import get_config_var, get_python_inc
from setuptools import find_packages, setup
from setuptools.extension import Extension
import versioneer
try:
from Cython.Distutils.build_ext import new_build_ext as build_ext
except ImportError:
from setuptools.command.build_ext import build_ext
with open("README.md", "r") as fh:
readme = fh.read()
include_dirs = [os.path.dirname(get_python_inc())]
library_dirs = [get_config_var("LIBDIR")]
libraries = ["ucp", "uct", "ucm", "ucs", "hwloc"]
extra_compile_args = ["-std=c99"]
ext_modules = [
Extension(
"ucp._libs.ucx_api",
sources=["ucp/_libs/ucx_api.pyx", "ucp/_libs/src/c_util.c"],
depends=["ucp/_libs/src/c_util.h", "ucp/_libs/ucx_api_dep.pxd"],
include_dirs=include_dirs,
library_dirs=library_dirs,
libraries=libraries,
extra_compile_args=extra_compile_args,
),
Extension(
"ucp._libs.arr",
sources=["ucp/_libs/arr.pyx"],
include_dirs=include_dirs,
library_dirs=library_dirs,
libraries=libraries,
extra_compile_args=extra_compile_args,
),
Extension(
"ucp._libs.topological_distance",
sources=[
"ucp/_libs/topological_distance.pyx",
"ucp/_libs/src/topological_distance.c",
],
depends=[
"ucp/_libs/src/topological_distance.h",
"ucp/_libs/topological_distance_dep.pxd",
],
include_dirs=include_dirs,
library_dirs=library_dirs,
libraries=libraries,
extra_compile_args=extra_compile_args,
),
]
cmdclass = dict()
cmdclass.update(versioneer.get_cmdclass())
cmdclass["build_ext"] = build_ext
install_requires = [
"numpy",
"psutil",
"pynvml",
]
tests_require = [
"pytest",
"pytest-asyncio",
]
setup(
name="ucx-py",
packages=find_packages(exclude=["tests*"]),
ext_modules=ext_modules,
cmdclass=cmdclass,
version=versioneer.get_version(),
python_requires=">=3.6",
install_requires=install_requires,
tests_require=tests_require,
description="Python Bindings for the Unified Communication X library (UCX)",
long_description=readme,
author="NVIDIA Corporation",
license="BSD-3-Clause",
zip_safe=False,
classifiers=[
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: BSD License",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Hardware",
"Topic :: System :: Systems Administration",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
],
url="https://github.com/rapidsai/ucx-py",
)