forked from BUPT-GAMMA/GammaGL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
74 lines (56 loc) · 1.79 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages, Extension
from setuptools.command.build_ext import build_ext as _build_ext
# cython compile
try:
from Cython.Build import cythonize
except ImportError:
def cythonize(*args, **kwargs):
"""cythonize"""
from Cython.Build import cythonize
return cythonize(*args, **kwargs)
class CustomBuildExt(_build_ext):
"""CustomBuildExt"""
def finalize_options(self):
_build_ext.finalize_options(self)
# Prevent numpy from thinking it is still in its setup process:
__builtins__.__NUMPY_SETUP__ = False
import numpy
self.include_dirs.append(numpy.get_include())
compile_extra_args = ["-std=c++11"]
link_extra_args = []
extensions = [
Extension(
"gammagl.sample",
sources=[os.path.join("gammagl", "sample.pyx")],
language="c++",
extra_compile_args=compile_extra_args,
extra_link_args=link_extra_args, ),
]
install_requires = ['numpy', 'scipy', 'pytest', 'cython', 'tensorflow', 'tensorlayerx']
classifiers = [
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: Apache Software License',
]
setup(
name="gammagl",
version="0.1.0",
author="BUPT-GAMMA LAB",
author_email="[email protected]",
maintainer="Tianyu Zhao",
license="Apache-2.0 License",
cmdclass={'build_ext': CustomBuildExt},
ext_modules=extensions,
description=" ",
url="https://github.com/BUPT-GAMMA/GammaGL",
download_url="https://github.com/BUPT-GAMMA/GammaGL",
python_requires='>=3.7',
packages=find_packages(),
install_requires=install_requires,
include_package_data=True,
classifiers=classifiers
)
# python setup.py build_ext --inplace
# python setup.py install