diff --git a/src/venvstacks/stacks.py b/src/venvstacks/stacks.py index fc58368..d70a554 100755 --- a/src/venvstacks/stacks.py +++ b/src/venvstacks/stacks.py @@ -1388,10 +1388,12 @@ def _create_new_environment(self, *, lock_only: bool = False) -> None: def _ensure_portability(self) -> None: # Wrapper and activation scripts are not used on deployment targets, # so drop them entirely rather than making them portable - for executable in self.executables_path.iterdir(): - if not executable.name.lower().startswith("python"): - print(f" Dropping potentially non-portable file {str(executable)!r}") - executable.unlink() + for item in self.executables_path.iterdir(): + if item.is_dir(): + shutil.rmtree(item) + elif not item.name.lower().startswith("python"): + print(f" Dropping potentially non-portable file {str(item)!r}") + item.unlink() # Symlinks within the build folder should be relative # Symlinks outside the build folder shouldn't exist build_path = self.build_path