Skip to content

Commit 5568599

Browse files
authored
Update setup.py
1 parent b2868f4 commit 5568599

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

setup.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from pip._internal.req import parse_requirements
66
from setuptools import setup, find_namespace_packages
7-
from setuptools.command.install import install
7+
from setuptools.command.build_py import build_py
88

99
# TODO: find from extras maybe
1010
HOST_MLIR_PYTHON_PACKAGE_PREFIX = os.environ.get(
@@ -24,13 +24,12 @@ def load_requirements(fname):
2424
] + [f"{HOST_MLIR_PYTHON_PACKAGE_PREFIX}.extras"]
2525

2626

27-
class MyInstallData(install):
27+
class MyInstallData(build_py):
2828
def run(self):
2929
from llvm import amdgcn
30-
self.mkpath(self.install_dir)
3130
shutil.copy(
3231
amdgcn.__file__,
33-
Path(self.install_dir)
32+
Path(self.build_lib)
3433
/ HOST_MLIR_PYTHON_PACKAGE_PREFIX
3534
/ "extras"
3635
/ "dialects"
@@ -39,7 +38,7 @@ def run(self):
3938
/ "amdgcn.py",
4039
)
4140

42-
install.run(self)
41+
build_py.run(self)
4342

4443

4544
setup(
@@ -60,5 +59,5 @@ def run(self):
6059
package_dir={
6160
f"{HOST_MLIR_PYTHON_PACKAGE_PREFIX}.extras": "mlir/extras",
6261
},
63-
cmdclass={"install": MyInstallData},
62+
cmdclass={"build_py": MyInstallData},
6463
)

0 commit comments

Comments
 (0)