You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the case that more than one virtual environment is found, it would be nice to have an option (maybe via --first or --auto) so that it runs with the first environment it discovers, rather than having to specify the venv manually.
The text was updated successfully, but these errors were encountered:
I'm not sure about adding a --first option. There is no explicit sorting criteria for the list of environments found, so I'm not sure adding an option relying on the order of environments is the best approach here.
Maybe this next comment bit off-topic and deserves an issue of its own, but nevertheless related: I guess we could try to think of ways of teaching venv-run to disambiguate and select the desired env for the user. Some approaches I can think of:
Use the most recent environment, i.e., the one that was created last;
Use the most recently used environment, i.e., the one that was last used via venv-run.
Both could be implemented and enabled via CLI flags.
Here's the behavior that led me to create the issue:
$ pipx run -q venv-run nvim
More than one virtual environment found:
/home/path/to/my/directory/venv
/home/steve/.pyenv/versions/3.11.6
Please, use the --venv option.
And my desire is to have venv-run "do the right thing" which is choose the correct virtualenv. In this case, the first virtualenv is the one I want, which is why I submitted such an opinionated suggestion. But taking a step back, perhaps we could add to your proposed list of heuristics: prioritizing a virtualenv that is closer (in the filesystem) to the command being run.
Thank you for this helpful utility!
In the case that more than one virtual environment is found, it would be nice to have an option (maybe via
--first
or--auto
) so that it runs with the first environment it discovers, rather than having to specify the venv manually.The text was updated successfully, but these errors were encountered: