-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
34 lines (24 loc) · 888 Bytes
/
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
#!/usr/bin/env python3
import pathlib
from distutils.core import setup, Extension
from distutils.command.build_ext import build_ext
import subprocess
import os
import shutil
SETUP_DIR = os.path.dirname(os.path.realpath(__file__))
BUILD_DIR = os.path.join(SETUP_DIR, "build")
class my_build_ext(build_ext):
def build_extension(self, ext):
from_ = os.path.join(BUILD_DIR, "plasma_runner_python.so")
to = self.get_ext_fullpath(ext.name)
print("Moving", from_, "to", to)
os.makedirs(os.path.dirname(to), exist_ok=True)
shutil.copyfile(from_, to)
setup(name="krunner",
version="0.1",
author="Matthew Joyce",
package_dir={"": os.path.join(SETUP_DIR, "src")},
py_modules=["krunner"],
ext_modules=[Extension("_krunner", [])],
author_email="[email protected]",
cmdclass={"build_ext": my_build_ext})