Skip to content

Commit

Permalink
abs
Browse files Browse the repository at this point in the history
  • Loading branch information
JarrettSJohnson committed May 13, 2024
1 parent 8b8f14d commit 4ace646
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ def build_cmake(self, ext):
build_temp = pathlib.Path(self.build_temp) / target_name
build_temp.mkdir(parents=True, exist_ok=True)
extdir = pathlib.Path(self.get_ext_fullpath(ext.name))
extdirabs = extdir.absolute()

extdir.parent.mkdir(parents=True, exist_ok=True)

Expand Down Expand Up @@ -227,7 +228,7 @@ def concat_paths(paths):
# Move up from VS release folder
cmake_lib_loc = pathlib.Path(lib_output_dir, "Release", f"{target_name}{shared_suffix}")
if cmake_lib_loc.exists():
shutil.move(cmake_lib_loc, extdir)
shutil.move(cmake_lib_loc, extdirabs)

# Troubleshooting: if fail on line above then delete all possible
# temporary CMake files including "CMakeCache.txt" in top level dir.
Expand Down Expand Up @@ -263,23 +264,6 @@ def finalize_options(self):
self.pymol_path = install_pymol.change_root(
self.root, self.pymol_path)

def install_lib_to(self, sub_dir_list: list[str], lib_name: str) -> None:
"""
Installs a library to the appropriate directory depending on the
operating system.
:sub_dir_list: The subdirectories where the library is located
relative to the build_lib and install_platlib directories.
:lib_name: The filename of the library (without the extension).
"""
lib_path = pathlib.Path(self.build_lib, *sub_dir_list)
suffix = sysconfig.get_config_var('EXT_SUFFIX')
if WIN:
lib_path = lib_path / "Release" / f"{lib_name}{suffix}"
else:
lib_path = lib_path / f"{lib_name}{suffix}"
dst = pathlib.Path(self.install_platlib, *sub_dir_list, f"{lib_name}{suffix}")
self.copy(str(lib_path), dst)

def run(self):
super().run()
self.install_pymol_path()
Expand Down

0 comments on commit 4ace646

Please sign in to comment.