tox-dev / tox-pyenv

plugin that tells tox to use `pyenv which` to find python executables

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

missing pyenv should not break tox

ssbarnea opened this issue · comments

If someone installs tox-pyenv module and pyenv tool is not present you endup with a totally broken tox which would fail to build any tox.ini file.

I think that tox-pyenv should only raise a warning if pyenv is not installed and avoid throwing an exception.

pyenv is used to get additional python interpreters on some platforms but this does not mean that they are really needed. If someone wants to fail on missing pyenv, you could add an enforcing option in the config.

Still, default behaviour should be not to break tox when pyenv is not installed.

[mini] err:   File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
[mini] err:     "__main__", fname, loader, pkg_name)
[mini] err:   File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
[mini] err:     exec code in run_globals
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/tox/__main__.py", line 4, in <module>
[mini] err:     main()
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/tox/session.py", line 39, in main
[mini] err:     retcode = Session(config).runcommand()
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/tox/session.py", line 390, in runcommand
[mini] err:     return self.subcommand_test()
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/tox/session.py", line 541, in subcommand_test
[mini] err:     if self.setupenv(venv):
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/tox/session.py", line 449, in setupenv
[mini] err:     status = venv.update(action=action)
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/tox/venv.py", line 161, in update
[mini] err:     self.hook.tox_testenv_create(action=action, venv=self)
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/pluggy.py", line 745, in __call__
[mini] err:     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/pluggy.py", line 339, in _hookexec
[mini] err:     return self._inner_hookexec(hook, methods, kwargs)
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/pluggy.py", line 334, in <lambda>
[mini] err:     _MultiCall(methods, kwargs, hook.spec_opts).execute()
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/pluggy.py", line 614, in execute
[mini] err:     res = hook_impl.function(*args)
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/tox/venv.py", line 398, in tox_testenv_create
[mini] err:     config_interpreter = venv.getsupportedinterpreter()
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/tox/venv.py", line 199, in getsupportedinterpreter
[mini] err:     return self.envconfig.getsupportedinterpreter()
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/tox/config.py", line 623, in getsupportedinterpreter
[mini] err:     info = self.config.interpreters.get_info(envconfig=self)
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/tox/interpreters.py", line 28, in get_info
[mini] err:     executable = self.get_executable(envconfig)
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/tox/interpreters.py", line 23, in get_executable
[mini] err:     exe = self.hook.tox_get_python_executable(envconfig=envconfig)
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/pluggy.py", line 745, in __call__
[mini] err:     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/pluggy.py", line 339, in _hookexec
[mini] err:     return self._inner_hookexec(hook, methods, kwargs)
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/pluggy.py", line 334, in <lambda>
[mini] err:     _MultiCall(methods, kwargs, hook.spec_opts).execute()
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/pluggy.py", line 614, in execute
[mini] err:     res = hook_impl.function(*args)
[mini] err:   File "/usr/local/lib/python2.7/dist-packages/tox_pyenv.py", line 83, in tox_get_python_executable
[mini] err:     "pyenv doesn't seem to be installed, you probably "
[mini] err: tox_pyenv.PyenvMissing: pyenv doesn't seem to be installed, you probably don't want this plugin installed either.

Is this issue not addressed by #11
?

I believe this is closed by #11. Please reopen if I misunderstood the issue.