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

Completion templates are missing #2424

Closed
skurfer opened this issue Jun 26, 2018 · 3 comments
Closed

Completion templates are missing #2424

skurfer opened this issue Jun 26, 2018 · 3 comments

Comments

@skurfer
Copy link
Contributor

skurfer commented Jun 26, 2018

pipenv --completion fails with jinja2.exceptions.TemplateNotFound.

$ python -m pipenv.help output

Pipenv version: '2018.05.18'

Pipenv location: '/usr/local/Cellar/pipenv/2018.5.18_1/libexec/lib/python3.6/site-packages/pipenv'

Python location: '/usr/local/Cellar/pipenv/2018.5.18_1/libexec/bin/python'

Other Python installations in PATH:

  • 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

  • 2.7: /usr/bin/python2.7

  • 2.7: /Users/rob/Developer/Python/Environments/tools2/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: /Users/rob/Developer/Python/Environments/tools/bin/python3.6

  • 3.6.5: /usr/local/opt/python/libexec/bin/python

  • 2.7.15: /usr/local/bin/python

  • 2.7.10: /usr/bin/python

  • 2.7.15: /usr/local/bin/python

  • 2.7.10: /usr/bin/python

  • 3.6.5: /Users/rob/Developer/Python/Environments/tools/bin/python

  • 2.7.15: /Users/rob/Developer/Python/Environments/tools2/bin/python

  • 2.7.15: /usr/local/bin/python2

  • 2.7.15: /usr/local/bin/python2

  • 2.7.15: /Users/rob/Developer/Python/Environments/tools2/bin/python2

  • 3.6.5: /usr/local/bin/python3

  • 3.6.5: /usr/local/bin/python3

  • 3.6.5: /Users/rob/Developer/Python/Environments/tools/bin/python3

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.6.5',
 '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.5',
 'python_version': '3.6',
 'sys_platform': 'darwin'}

System environment variables:

  • TMPDIR
  • XPC_FLAGS
  • Apple_PubSub_Socket_Render
  • TERM
  • SSH_AUTH_SOCK
  • SECURITYSESSIONID
  • XPC_SERVICE_NAME
  • TERM_PROGRAM
  • TERM_PROGRAM_VERSION
  • TERM_SESSION_ID
  • SHELL
  • HOME
  • LOGNAME
  • USER
  • PATH
  • SHLVL
  • PWD
  • OLDPWD
  • PAGER
  • EDITOR
  • DISABLE_UNTRACKED_FILES_DIRTY
  • HISTFILE
  • HISTSIZE
  • SAVEHIST
  • LESS
  • RSYNC_RSH
  • GREP_COLOR
  • LSCOLORS
  • FZF_TMUX
  • FZF_TMUX_HEIGHT
  • FZF_DEFAULT_OPTS
  • KRB5_CONFIG
  • WORKON_HOME
  • PROJECT_HOME
  • PYENV_ROOT
  • PY2
  • LC_CTYPE
  • EVENT_NOKQUEUE
  • LESSEDIT
  • JAVA_HOME
  • LANG
  • VIRTUAL_ENV_DISABLE_PROMPT
  • VIRTUALENVWRAPPER_PROJECT_FILENAME
  • VIRTUALENVWRAPPER_WORKON_CD
  • VIRTUALENVWRAPPER_SCRIPT
  • VIRTUALENVWRAPPER_HOOK_DIR
  • PIPENV_VENV_IN_PROJECT
  • ZSH_TMUX_TERM
  • _ZSH_TMUX_FIXED_CONFIG
  • REPORTTIME
  • _
  • __CF_USER_TEXT_ENCODING
  • PYTHONDONTWRITEBYTECODE
  • PIP_PYTHON_PATH

Pipenv–specific environment variables:

  • PIPENV_VENV_IN_PROJECT: 1

Debug–specific environment variables:

  • PATH: /usr/local/opt/python/libexec/bin:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/Users/rob/Developer/Python/Environments/tools/bin:/Users/rob/Developer/Python/Environments/tools2/bin:/Users/rob/bin:.
  • SHELL: /usr/local/bin/zsh
  • EDITOR: mate_wait
  • LANG: en_US.UTF-8
  • PWD: /Users/rob

------------

Details

Templates are included with the source

$ find . -name '*j2'
./pipenv/vendor/click_completion/fish.j2
./pipenv/vendor/click_completion/bash.j2
./pipenv/vendor/click_completion/powershell.j2
./pipenv/vendor/click_completion/zsh.j2

but are not included in the package.

Homebrew:

$ find /usr/local/Cellar/pipenv -name '*j2'

Virtual Environment:

$ find $VIRTUAL_ENV -name '*j2'

The full error (using the Homebrew version):

Traceback (most recent call last):
  File "/usr/local/Cellar/pipenv/2018.6.25/libexec/bin/pipenv", line 11, in <module>
    load_entry_point('pipenv==2018.6.25', 'console_scripts', 'pipenv')()
  File "/usr/local/Cellar/pipenv/2018.6.25/libexec/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/Cellar/pipenv/2018.6.25/libexec/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/Cellar/pipenv/2018.6.25/libexec/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1043, in invoke
    return Command.invoke(self, ctx)
  File "/usr/local/Cellar/pipenv/2018.6.25/libexec/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/Cellar/pipenv/2018.6.25/libexec/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/Cellar/pipenv/2018.6.25/libexec/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/Cellar/pipenv/2018.6.25/libexec/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/Cellar/pipenv/2018.6.25/libexec/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/Cellar/pipenv/2018.6.25/libexec/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/Cellar/pipenv/2018.6.25/libexec/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/Cellar/pipenv/2018.6.25/libexec/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/Cellar/pipenv/2018.6.25/libexec/lib/python3.6/site-packages/pipenv/vendor/jinja2/loaders.py", line 187, in get_source
    raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: zsh.j2
@erinxocon
Copy link
Contributor

Hi @skurfer! Thanks for taking the time to report this issue. We already had a report about it and this will be fixed when PR #2422 is merged.

@skurfer
Copy link
Contributor Author

skurfer commented Jun 26, 2018

OK, I didn't see it reported. Sorry for the noise.

@erinxocon
Copy link
Contributor

@skurfer No worries, I don't think there was a report, I just happened to see a PR with the fix come across this morning.

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