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

pipenv --completion raises TemplateNotFound exception #2431

Closed
command-tab opened this issue Jun 26, 2018 · 3 comments
Closed

pipenv --completion raises TemplateNotFound exception #2431

command-tab opened this issue Jun 26, 2018 · 3 comments

Comments

@command-tab
Copy link

command-tab commented Jun 26, 2018

pipenv --completion used to output Bash completion commands. It now raises a TemplateNotFound exception:

$ pipenv --completion
Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1043, in invoke
    return Command.invoke(self, ctx)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pipenv/cli.py", line 178, in cli
    print(click_completion.get_code(shell=shell, prog_name='pipenv'))
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click_completion/__init__.py", line 353, in get_code
    template = env.get_template('%s.j2' % shell)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/jinja2/environment.py", line 830, in get_template
    return self._load_template(name, self.make_globals(globals))
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/jinja2/environment.py", line 804, in _load_template
    template = self.loader.load(self, name, globals)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/jinja2/loaders.py", line 113, in load
    source, filename, uptodate = self.get_source(environment, name)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/jinja2/loaders.py", line 187, in get_source
    raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: bash.j2
$ python -m pipenv.help output

Pipenv version: '2018.6.25'

Pipenv location: '/usr/local/lib/python3.6/site-packages/pipenv'

Python location: '/usr/local/opt/python/bin/python3.6'

Other Python installations in PATH:

  • 2.7: /usr/local/bin/python2.7

  • 2.7: /usr/local/bin/python2.7

  • 2.7: /usr/local/bin/python2.7

  • 2.7: /usr/bin/python2.7

  • 2.7: /usr/local/bin/python2.7

  • 3.6: /usr/local/bin/python3.6m

  • 3.6: /usr/local/bin/python3.6

  • 3.6: /usr/local/bin/python3.6

  • 3.6: /usr/local/bin/python3.6

  • 2.7.14: /usr/local/bin/python

  • 2.7.14: /usr/local/bin/python

  • 2.7.10: /usr/bin/python

  • 2.7.14: /usr/local/bin/python

  • 2.7.14: /usr/local/bin/python2

  • 2.7.14: /usr/local/bin/python2

  • 2.7.14: /usr/local/bin/python2

  • 3.6.4: /usr/local/bin/python3

  • 3.6.4: /usr/local/bin/python3

  • 3.6.4: /usr/local/bin/python3

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.6.4',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '17.6.0',
 'platform_system': 'Darwin',
 'platform_version': 'Darwin Kernel Version 17.6.0: Tue May  8 15:22:16 PDT '
                     '2018; root:xnu-4570.61.1~1/RELEASE_X86_64',
 'python_full_version': '3.6.4',
 'python_version': '3.6',
 'sys_platform': 'darwin'}

System environment variables:

  • LC_ALL
  • PYENV_VIRTUALENV_DISABLE_PROMPT
  • LANG
  • XPC_FLAGS
  • HISTCONTROL
  • LESS
  • DISPLAY
  • TERM_SESSION_ID
  • EDITOR
  • __CF_USER_TEXT_ENCODING
  • GIT_EDITOR
  • SSH_AUTH_SOCK
  • USER
  • PAGER
  • LSCOLORS
  • RBENV_SHELL
  • SSH_CLIENT_USER
  • PWD
  • MANPAGER
  • HOME
  • TERM_PROGRAM
  • TERM_PROGRAM_VERSION
  • Apple_PubSub_Socket_Render
  • SVN_EDITOR
  • TMPDIR
  • PIPENV_NOSPIN
  • XPC_SERVICE_NAME
  • TERM
  • SHELL
  • TNS_ADMIN
  • VAULT_ADDR
  • PYTHONDONTWRITEBYTECODE
  • SHLVL
  • MANPATH
  • LOGNAME
  • PATH
  • PIPENV_HIDE_EMOJIS
  • HOMEBREW_GITHUB_API_TOKEN
  • _
  • OLDPWD
  • PIP_PYTHON_PATH

Pipenv–specific environment variables:

  • PIPENV_NOSPIN: 1
  • PIPENV_HIDE_EMOJIS: 1

Debug–specific environment variables:

  • PATH: /usr/sbin:/usr/local/bin:/usr/local/sbin:/Users/callen/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/local/bin
  • SHELL: /bin/bash
  • EDITOR: /usr/local/bin/mate -w
  • LANG: en_US.UTF-8
  • PWD: /Users/callen/Desktop


Expected result

I expected pipenv --completion to output Bash completion snippet.

Actual result

It raises a TemplateNotFound exception.

Steps to replicate
  1. Install pipenv under Python 3.6
  2. Run pipenv --completion
@command-tab
Copy link
Author

Of note: When I uninstall pipenv 2018.6.25 and install 2018.05.18, pipenv --completion works again. Thus it seems it was broken in the most recent release. I'm trying to find a specific commit...

@command-tab
Copy link
Author

Possibly related: #2422

@techalchemy
Copy link
Member

Fix is already merged, thanks for the report. See #2422

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