Improve detection of installed Python version #221
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First, this commit adds detection of Python versions installed via Python.org's Mac OS installers (which are installed in
/Library/Frameworks/Python.framework/Versions/
). virtualfish will prefer Python.org installations over Homebrew Python, butasdf
,pyenv
, orpythonz
are preferred over Python.org installs.Second, this commit fixes an issue in how Python versions are deteced when calling
vf new -p
orvf upgrade -p
. Before this commit, virtualfish checked if various executables are available, but didn't continue to search if the specified Python version has not been installed in the first available application. For example, ifpyenv
is installed but the specified Python version has not been installed withpyenv
, virtualfish will directly fall back to pass to Virtualenv as-is instead of continuing the search in, say,pythonz
or Homebrew.While it is unlikely that one would have both
pyenv
andpythonz
installed, continuing to search for a Python version if it hasn't been installed in the first application found is useful with regards to detecting Python.org installs. One might mostly usepyenv
, but has issues compiling a particular Python version with it and therefore installs it with Python.org's Mac installer.