diff --git a/setup.py b/setup.py index df22dad..27a017b 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ import shutil +import stat from pathlib import Path from typing import Generator, Optional from zipfile import ZipFile @@ -63,11 +64,12 @@ def run(self): if isinstance(ext, PrecompiledExtension) and ext.path.name.endswith( self.suffix() ): - dest = Path(self.build_lib) / ext.path.parent.relative_to( + dest = Path(self.build_lib) / ext.path.relative_to( Path(__file__).parent.absolute() ) - dest.mkdir(parents=True, exist_ok=True) - shutil.copy(ext.path, dest) + dest.parent.mkdir(parents=True, exist_ok=True) + shutil.copy(ext.path, dest.parent) + dest.chmod(dest.stat().st_mode | stat.S_IEXEC) def find_extensions(directory: Path) -> list[PrecompiledExtension]: