Skip to content

Commit

Permalink
ENH: Refractoring setup.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
MilanSkocic committed Jun 17, 2024
1 parent c711937 commit 4f8f11b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions py/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
library_dirs = None
runtime_library_dirs = None
extra_objects = None
ext = None
ext = [".so"]


if platform.system() == "Linux":
Expand Down Expand Up @@ -78,25 +78,25 @@
for file in files:
src = root_src / (file + ext[0])
dest = root_dest / (file + ext[0])
cmd = ["install_name_tool", "-change", f"{str(src):s}", f"@loader_path/{src.name}", f"./src/py{name:s}/lib{name:s}{ext[0]:s}"]
try:
print(f"copying {str(src):s} -> {str(dest.parent):s}.")
shutil.copy(src, dest)
if platform.system() == "Darwin":
cmd = ["install_name_tool", "-change", f"{str(src):s}", f"@loader_path/{src.name}", f"./src/py{name:s}/lib{name:s}{ext[0]:s}"]
print(cmd)
subprocess.check_call(cmd)
except subprocess.CalledProcessError:
print(cmd + " was not successful.")
print(" ".join(cmd) + " was not successful.")
except:
print(f"{file:s} was not found.")

# check rpaths for Darwin
if platform.system() == "Darwin":
cmd = ["otool", "-L", f"./src/py{name:s}/lib{name:s}{ext[0]:s}"]
try:
cmd = ["otool", "-L", f"./src/py{name:s}/lib{name:s}{ext[0]:s}"]
subprocess.check_call(cmd)
except subprocess.CalledProcessError:
print(cmd + " was not successful.")
print(" ".join(cmd) + " was not successful.")

version = None
with open("./VERSION", "r") as f:
Expand Down

0 comments on commit 4f8f11b

Please sign in to comment.