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

Improve detection of installed Python version #221

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sbaack
Copy link

@sbaack sbaack commented Apr 1, 2022

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, but asdf, pyenv, or pythonz are preferred over Python.org installs.

Second, this commit fixes an issue in how Python versions are deteced when calling vf new -p or vf 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, if pyenv is installed but the specified Python version has not been installed with pyenv, 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 and pythonz 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 use pyenv, but has issues compiling a particular Python version with it and therefore installs it with Python.org's Mac installer.

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, but asdf,
pyenv, or pythonz are preferred over Python.org installs.

Second, this commit fixes an issue in how Python versions are deteced
when calling 'vf new -p' or 'vf 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 with said application. For example, if 'pyenv' is available
but the specified Python version has not been installed with pyenv,
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 and pythonz
installed, continuing to search for Python versions if it hasn't been
installed in the first application found is useful with regards to detecting
Python.org installs. One might mostly use pyenv, but has issues
compiling a particular Python version with it and therefore installs
it with Python.org's Mac installer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant