From 91952ab2a036df93b95e6bc5eb985d4267ddaba7 Mon Sep 17 00:00:00 2001 From: Jagan Prem Date: Mon, 6 Nov 2023 02:37:59 -0800 Subject: [PATCH] Add executable permission to vendor file --- setup.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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]: