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

Fix for cases in the virtualenv plugin where pyenv is present but pyenv virtualenvwrapper isn't #2288

Merged
merged 4 commits into from
Feb 11, 2025

Conversation

LoKolbasz
Copy link
Contributor

@LoKolbasz LoKolbasz commented Feb 11, 2025

Description

Check for the whole pyenv virtualenvwrapper command when loading virtualenv, instead of checking for pyenv only

Motivation and Context

This is useful if the system has pyenv installed but not pyenv virtulenvwrapper. The previous version just printed out

pyenv: no such command `sh-virtualenvwrapper'

which is just the pyenv stderr output.

How Has This Been Tested?

Tested both with and pyenv virtualenvwrapper present. In both cases virtualenvwrapper.sh was also present. In poth cases ´ _virtualenvwrapper_version´ returned with the verion value. I renamed the plugins in enabled, to ensure that pyenv gets loaded first during debugging. I don't remember the original loading order, but pyenv must be loaded first so that the plugin would work. Otherwise pyenv prints the following:

Failed to initialize virtualenvwrapper.

Perhaps pyenv-virtualenvwrapper has not been loaded into your shell properly.
Please restart current shell and try again.

Screenshots (if appropriate):

Types of changes

  • [ x] Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • [ x] My code follows the code style of this project.
  • [ x] If my change requires a change to the documentation, I have updated the documentation accordingly.
  • [ x] I have read the CONTRIBUTING document.
  • [ x] If I have added a new file, I also added it to clean_files.txt and formatted it using lint_clean_files.sh.
  • I have added tests to cover my changes, and all the new and existing tests pass.

Copy link
Contributor

@seefood seefood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems legit.

@seefood seefood merged commit f42295e into Bash-it:master Feb 11, 2025
7 checks passed
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.

2 participants