-
Notifications
You must be signed in to change notification settings - Fork 76
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
Fix & always include bin/activate in python & poetry plugin #2036
Conversation
@lengau is this a change you want to include in charmcraft? so that the or would it be better to include these commands manually in override-build, in case the format of the poetry-keep-bins: true
override-build: |
craftctl default
# Remove venv/bin/ (included because `poetry-keep-bins: true`) except for venv/bin/activate
shopt -s extglob
rm -r "$CRAFT_PART_INSTALL/venv/bin/"!(activate)
# Replace hard-coded path in `venv/bin/activate` with portable path
# "\&" is escape for sed
sed -i 's#^VIRTUAL_ENV=.*$#VIRTUAL_ENV="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )/.." \&> /dev/null \&\& pwd )"#' "$CRAFT_PART_INSTALL/venv/bin/activate" |
delete_bins = [ | ||
# Remove all files in venv_bin except `activate` | ||
"shopt -s extglob", | ||
f"rm -rf {venv_bin}/!(activate)", |
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.
@carlcsaposs-canonical with the option to keep all the bins I think we can leave the Could you fix the lint and the tests ( |
648b703
to
8b8bdf1
Compare
@lengau if keep bins is True, should we still modify |
@carlcsaposs-canonical let's just always modify it. |
Including `bin/activate` in the virtual environment will make debugging much easier (charm developers can easily run Python code using the charm's virtual environment to debug issues)
8b8bdf1
to
f0fd1d2
Compare
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.
Thanks!
Including
bin/activate
in the virtual environment will make debugging much easier (charm developers can easily run Python code using the charm's virtual environment to debug issues)