Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove directories in /bin when ensuring portability #103

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/venvstacks/stacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading