-
Notifications
You must be signed in to change notification settings - Fork 2
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
add EXTERNALLY-MANAGED #7
Conversation
I'm not too sure yet about writing the files directly to the target environment. It creates the opportunity for lingering files unless the user removes packages nicely. Maybe an alternative is to inject a fake |
Pinging @jezdez @pradyunsg for awareness / comments if time allows :) |
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.
Noice!
externally_managed.unlink() | ||
place_externally_managed(target_prefix) | ||
else: # remove | ||
if list(prefix_data.query("pip")): |
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.
Any exception expected with this call?
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.
.query()
returns a generator. Worst case it's empty because there were no matches.
yield plugins.CondaPostCommand( | ||
name="conda-pip-ensure-target-env-has-externally-managed", | ||
action=ensure_target_env_has_externally_managed, | ||
run_for={"install", "create", "update", "remove"}, |
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.
This should also cover the various env
subcommands
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.
It's tricky to know how we should handle this in combination with the potential conda env
hook. I'd rather think about in a different PR so the conversations are well captured separately.
Co-authored-by: Jannis Leidel <jannis@leidel.info>
…to externally-managed
Closes #1
In this PR, we are implementing the following behavior:
conda-pip
packaged files includeEXTERNALLY-MANAGED
by default. This protects thebase
environment (or whateverconda-pip
has been installed to; usuallybase
).EXTERNALLY-MANAGED
afterconda pip -p target install ...
executions.EXTERNALLY-MANAGED
if the target environment haspip
.lib/pythonX.Y
directory to the new one.pip
is not present in the target environment anymore.conda-pip
is present inbase
as a dependency and not explicitly installed (we check the history file for explicit presence ofconda-pip
).To do / discuss:
conda remove --all
is invoked? This should be caught by the post-command plugin anyway, but a few empty directories might be in place? Maybeconda
clears the tree? Investigate.conda env remove
.References: