-
Notifications
You must be signed in to change notification settings - Fork 10
Add --break-system-packages when using --target #218
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds the --break-system-packages
flag to pip commands when installing to a specific target directory outside of system containers. The change addresses pip's restriction on installing packages to custom directories when not in a virtual environment.
- Adds conditional logic to append
--break-system-packages
when--target
or--path
options are present - Only applies this flag when not using system pip installation locations (i.e., outside containers/virtual environments)
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
elif "--target" in args or "--path" in args: | ||
# If we are not running in some sort of container, and are instead trying to install to a | ||
# specific directory, pip will complain because it doesn't know that we're effectively | ||
# using this as a virtual env: it's not accessible to non-FreeCAD installations (at least, | ||
# not without some extra work on the user's part). So add the --break-system-packages flag | ||
# so pip will allow us to write to the --target directory | ||
args.append("--break-system-packages") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The --break-system-packages
flag is being added even if it already exists in the args list, which could result in duplicate flags. Consider checking if the flag is already present before appending it.
elif "--target" in args or "--path" in args: | |
# If we are not running in some sort of container, and are instead trying to install to a | |
# specific directory, pip will complain because it doesn't know that we're effectively | |
# using this as a virtual env: it's not accessible to non-FreeCAD installations (at least, | |
# not without some extra work on the user's part). So add the --break-system-packages flag | |
# so pip will allow us to write to the --target directory | |
args.append("--break-system-packages") | |
if "--break-system-packages" not in args: | |
args.append("--break-system-packages") |
Copilot uses AI. Check for mistakes.
Successfully created backport PR for |
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin main
git worktree add -d .worktree/backport-218-to-main origin/main
cd .worktree/backport-218-to-main
git switch --create backport-218-to-main
git cherry-pick -x 48a0e1f9d6f90bd3cef82c4ea45d1a44e3abaaff |
Fixes #8