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

What does vf check when it decides an env is "broken" ? #229

Closed
2 tasks done
amj opened this issue Jul 16, 2022 · 5 comments
Closed
2 tasks done

What does vf check when it decides an env is "broken" ? #229

amj opened this issue Jul 16, 2022 · 5 comments
Labels

Comments

@amj
Copy link

amj commented Jul 16, 2022

  • I have searched the issues (including closed ones) and believe that this is not a duplicate.
  • If related to a plugin, I prefixed the issue title with the name of the plugin.

Issue

hi there, long time user, was noticing this fancy "broken" descriptor in vf --ls and was curious what it means/what it checks? There doesn't seem to be any mention of what triggers vf as detecting a venv as "broken" and/or what it means for "upgrade" to fix them.

after a bit of troubleshooting, it looks like vf checks the status of python -m pip & throws away the output. I had a few venv's that i had created with --no-pip and that was the issue.

@amj amj added the docs label Jul 16, 2022
@amj
Copy link
Author

amj commented Jul 17, 2022

One possibility would be to change this line

set -l test_py (fish -c "'$python_path' $pipflag -V" 2>/dev/null)
, instead piping to something in /tmp/, so the caller could dump it out on a nonzero return code.

@justinmayer
Copy link
Owner

Hey Andrew. An alternative approach would be to change the test to account for the use case in which --no-pip has been invoked. Can you think of other ways of detecting when the virtual environment has lost all motor function? 😉

@amj
Copy link
Author

amj commented Jul 18, 2022

No, but i'm not the right guy to ask because i'm not an expert on the edge cases of virtualenvs, i'm just a guy trying to keep projects isolated and know that venv's are the way to do it in python.

i mean, all i really wanted was to know what was meant by "broken" 🙃. After digging in to find out, i still only understand one way that it can be broken (my way), so i'm pretty sure i don't know what's the best way to document what it needs.

@justinmayer
Copy link
Owner

In the past, the most common way I encountered broken virtual environments was when Homebrew upgraded Python (without my explicit invocation, mind you). For that reason, I no longer use Homebrew Python, as documented in Homebrew Python Is Not For You.

On another note, I don't understand the motivation behind creating environments without Pip. Could you elaborate regarding why you use that flag?

In any case, if you would like to propose a PR to address the /dev/null'ed error output, that might be (as you suggested) the best way to address the specific issue you experienced.

@justinmayer
Copy link
Owner

Creating virtual environments without Pip installed is, from my perspective, an edge case. As such, I can't devote any time to supporting that edge case. But if someone else wants to pick up that endeavor, pull requests to that effect are welcome. 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants