| 128 | ) |
| 129 | |
| 130 | def _move_exec_to_root(self, build_dir: Path): |
| 131 | walk_dir = Path(build_dir) / self.meson_build_dir |
| 132 | path_objects = chain( |
| 133 | walk_dir.glob(f"{self.modulename}*.so"), |
| 134 | walk_dir.glob(f"{self.modulename}*.pyd"), |
| 135 | ) |
| 136 | # Same behavior as distutils |
| 137 | # https://github.com/numpy/numpy/issues/24874#issuecomment-1835632293 |
| 138 | for path_object in path_objects: |
| 139 | dest_path = Path.cwd() / path_object.name |
| 140 | if dest_path.exists(): |
| 141 | dest_path.unlink() |
| 142 | shutil.copy2(path_object, dest_path) |
| 143 | os.remove(path_object) |
| 144 | |
| 145 | def write_meson_build(self, build_dir: Path) -> None: |
| 146 | """Writes the meson build file at specified location""" |