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: check for both python3 and python in exec-env #78

Merged

Conversation

adamfeldman
Copy link
Contributor

This fix enables the use of Homebrew-installed Python with this plugin.

See also 9d7ff92 for an earlier commit that adjusted python --> python3.

Description

Changes bin/exec-env to check for python3 instead of python.

Motivation and Context

Not working, on macOS with Homebrew-installed Python:

➜ ~ gcloud --version
🚨 Python not found and is required for gcloud. Might I suggest https://github.com/danhper/asdf-python
➜ ~ command -v python
➜ ~
➜ ~ command -v python3
/opt/homebrew/bin/python3

An alias doesn't fix it either:

➜ ~ command -v python
alias python=python3
➜ ~ command -v python3
/opt/homebrew/bin/python3
➜ ~ gcloud help
🚨 Python not found and is required for gcloud. Might I suggest https://github.com/danhper/asdf-python
➜ ~ which python
python: aliased to python3
➜ ~ which python3
/opt/homebrew/bin/python3

After applying the change, it works:

➜ ~ gcloud --version
Google Cloud SDK 433.0.0
bq 2.0.93
core 2023.05.26
gcloud-crc32c 1.0.0
gsutil 5.24

Types of changes

  • 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)

Usage examples

How Has This Been Tested?

Checklist:

  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@jthegedus
Copy link
Owner

Thanks for the PR @adamfeldman

I made a change so that it prefers python3 but if it is not found falls back to python.

@jthegedus jthegedus changed the title fix: check for python3, not python, in exec-env fix: check for both python3 and python in exec-env Jun 18, 2023
@jthegedus jthegedus merged commit 502fd1c into jthegedus:main Jun 18, 2023
@adamfeldman
Copy link
Contributor Author

Awesome, thank you @jthegedus!

@jthegedus
Copy link
Owner

Sorry for the delay 😅

@adamfeldman
Copy link
Contributor Author

You were plenty quick! Thank you for maintaining this! 😄 🚀

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