-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
59 lines (48 loc) · 1.49 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
from setuptools import find_packages
from setuptools import setup
from setuptools.command.install import install
from setuptools.command.develop import develop
import subprocess
import sys
install_requires = []
test_requires = [
"pytest",
"pytest-cov",
]
class CustomCommand:
"""Common functionality for install and develop commands"""
def run_setup_ops(self):
try:
subprocess.check_call([sys.executable, "setup_ops.py", "install"])
except subprocess.CalledProcessError as e:
print(f"Error running setup_ops.py: {e}")
raise
except Exception as e:
print(f"Unexpected error: {e}")
raise
class CustomInstallCommand(install, CustomCommand):
def run(self):
self.run_setup_ops()
install.run(self)
class CustomDevelopCommand(develop, CustomCommand):
def run(self):
self.run_setup_ops()
develop.run(self)
setup(
name="paddle_scatter",
version="1.0",
description="Paddle Extension Library of Optimized Scatter Operations, originally from https://github.com/rusty1s/pytorch_scatter",
author="NKNaN",
url="https://github.com/PFCCLab/paddle_scatter",
keywords=["paddle", "scatter", "segment", "gather"],
python_requires=">=3.8",
install_requires=install_requires,
extras_require={
"test": test_requires,
},
cmdclass={
"install": CustomInstallCommand,
"develop": CustomDevelopCommand,
},
packages=find_packages(),
)