Skip to content

Commit

Permalink
Remove directories in /bin when ensuring portability
Browse files Browse the repository at this point in the history
  • Loading branch information
neilmehta24 committed Dec 18, 2024
1 parent 235ce3b commit 25d033b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/venvstacks/stacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1388,10 +1388,13 @@ 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 not item.name.lower().startswith("python"):
print(f" Dropping potentially non-portable file {str(item)!r}")
if item.is_dir():
shutil.rmtree(item)
else:
item.unlink()
# Symlinks within the build folder should be relative
# Symlinks outside the build folder shouldn't exist
build_path = self.build_path
Expand Down

0 comments on commit 25d033b

Please sign in to comment.