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

bash completion broken on MacOS & bash < 4.4 #4859

Closed
milo-minderbinder opened this issue Nov 11, 2021 · 1 comment
Closed

bash completion broken on MacOS & bash < 4.4 #4859

milo-minderbinder opened this issue Nov 11, 2021 · 1 comment

Comments

@milo-minderbinder
Copy link
Contributor

Issue description

Since #4849 was merged, bash completion is no longer available for bash bundled with MacOS (bundled version is 3.2) and other environments where installed bash version < 4.4, due to the minimum bash version requirement described in the first line of the click docs here: https://click.palletsprojects.com/en/8.0.x/shell-completion/.

Expected result

Bash completion would continue to work on standard MacOS environments.

Actual result

Bash completion support is broken on MacOS with bundled bash:

Steps to replicate

$ uname -mprsv
Darwin 20.6.0 Darwin Kernel Version 20.6.0: Tue Oct 12 18:33:42 PDT 2021; root:xnu-7195.141.8~1/RELEASE_X86_64 x86_64 i386
$ bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin20)
Copyright (C) 2007 Free Software Foundation, Inc.
$ pipenv --version
pipenv, version 2021.11.9
$ eval "$(_PIPENV_COMPLETE=bash_source pipenv)"
Traceback (most recent call last):
  File "/usr/local/Cellar/pipenv/2021.11.9/libexec/bin/pipenv", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/Cellar/pipenv/2021.11.9/libexec/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1137, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/Cellar/pipenv/2021.11.9/libexec/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1057, in main
    self._main_shell_completion(extra, prog_name, complete_var)
  File "/usr/local/Cellar/pipenv/2021.11.9/libexec/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1132, in _main_shell_completion
    rv = shell_complete(self, ctx_args, prog_name, complete_var, instruction)
  File "/usr/local/Cellar/pipenv/2021.11.9/libexec/lib/python3.10/site-packages/pipenv/vendor/click/shell_completion.py", line 45, in shell_complete
    echo(comp.source())
  File "/usr/local/Cellar/pipenv/2021.11.9/libexec/lib/python3.10/site-packages/pipenv/vendor/click/shell_completion.py", line 324, in source
    self._check_version()
  File "/usr/local/Cellar/pipenv/2021.11.9/libexec/lib/python3.10/site-packages/pipenv/vendor/click/shell_completion.py", line 312, in _check_version
    raise RuntimeError(
RuntimeError: Shell completion is not supported for Bash versions older than 4.4.

$ pipenv --support

Pipenv version: '2021.11.9'

Pipenv location: '/usr/local/Cellar/pipenv/2021.11.9/libexec/lib/python3.10/site-packages/pipenv'

Python location: '/usr/local/Cellar/pipenv/2021.11.9/libexec/bin/python3.10'

Python installations found:

  • 3.9.7: /usr/local/bin/python3
  • 3.9.7: /usr/local/bin/python3.9
  • 3.9.5: /Users/milo/.pyenv/versions/3.9.5/bin/python3
  • 3.8.12: /Users/milo/.pyenv/versions/3.8.12/bin/python3
  • 3.8.9: /usr/bin/python3
  • 3.7.11: /Users/milo/.pyenv/versions/3.7.11/bin/python3
  • 2.7.16: /usr/bin/python
  • 2.7.16: /usr/bin/python2
  • 2.7.16: /usr/bin/python2.7
  • 2.7.2: /usr/local/bin/jython

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.10.0',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '20.6.0',
 'platform_system': 'Darwin',
 'platform_version': 'Darwin Kernel Version 20.6.0: Tue Oct 12 18:33:42 PDT '
                     '2021; root:xnu-7195.141.8~1/RELEASE_X86_64',
 'python_full_version': '3.10.0',
 'python_version': '3.10',
 'sys_platform': 'darwin'}

System environment variables:

  • PATH
  • NVM_INC
  • TERM_PROGRAM
  • PYENV_ROOT
  • NVM_CD_FLAGS
  • M2
  • SHELL
  • TERM
  • SHELLCHECK_OPTS
  • TMPDIR
  • GRADLE_HOME
  • TERM_PROGRAM_VERSION
  • TERM_SESSION_ID
  • ANSIBLE_VAULT_PASSWORD_FILE
  • NVM_DIR
  • JRE_HOME
  • USER
  • HUSKY_SKIP_INSTALL
  • SSH_AUTH_SOCK
  • JAVA7
  • JAVA8
  • BASH_SILENCE_DEPRECATION_WARNING
  • WORKON_HOME
  • OLD_PS1
  • _
  • __CFBundleIdentifier
  • PWD
  • HOMEBREW_GITHUB_API_TOKEN
  • JAVA_HOME
  • EDITOR
  • LANG
  • XPC_FLAGS
  • XPC_SERVICE_NAME
  • GPG_TTY
  • PYENV_SHELL
  • M2_HOME
  • SHLVL
  • HOME
  • GOROOT
  • JAVA11
  • LOGNAME
  • GROOVY_HOME
  • JAVA17
  • NVM_BIN
  • GOPATH
  • ANSIBLE_CONFIG
  • LPASS_CLIPBOARD_COMMAND
  • __CF_USER_TEXT_ENCODING
  • PIP_SHIMS_BASE_MODULE
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PYTHONDONTWRITEBYTECODE
  • PIP_PYTHON_PATH
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /usr/local/Cellar/pipenv/2021.11.9/libexec/tools:/Users/milo/.pyenv/shims:/Users/milo/.nvm/versions/node/v16.13.0/bin:/Users/milo/go/bin:/usr/local/opt/go/libexec/bin:/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
  • SHELL: /bin/bash
  • EDITOR: /usr/local/bin/vim
  • LANG: en_US.UTF-8
  • PWD: /Users/milo

@frostming
Copy link
Contributor

Not much Pipenv can do here, as long as we depend on click to provide completion.

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

No branches or pull requests

2 participants