fedora-python / tox-current-env

tox plugin to run tests in current Python environment
https://pypi.org/project/tox-current-env/
MIT License
23 stars 8 forks source link

tox --print-deps-only fails if there's no python command #9

Closed hroncok closed 5 years ago

hroncok commented 5 years ago

Currently, --print-deps-only fails if invoked without previously running --current-env or regular tox on systems without the python command:

$ tox --print-deps-only -e py37
py37 create: /tmp/pytest-of-mockbuild/pytest-0/test_data_Tox_depndencies_pypr0/cwd/.tox/py37
____________________________________________________ summary ____________________________________________________
  py37: commands succeeded
  congratulations :)
Traceback (most recent call last):
  File "/usr/bin/tox", line 11, in <module>
    load_entry_point('tox==3.13.2', 'console_scripts', 'tox')()
  File "/usr/lib/python3.7/site-packages/tox/session/__init__.py", line 44, in cmdline
    main(args)
  File "/usr/lib/python3.7/site-packages/tox/session/__init__.py", line 68, in main
    exit_code = session.runcommand()
  File "/usr/lib/python3.7/site-packages/tox/session/__init__.py", line 192, in runcommand
    return self.subcommand_test()
  File "/usr/lib/python3.7/site-packages/tox/session/__init__.py", line 220, in subcommand_test
    run_sequential(self.config, self.venv_dict)
  File "/usr/lib/python3.7/site-packages/tox/session/commands/run/sequential.py", line 9, in run_sequential
    if venv.setupenv():
  File "/usr/lib/python3.7/site-packages/tox/venv.py", line 618, in setupenv
    command_path = self.getcommandpath("python")
  File "/usr/lib/python3.7/site-packages/tox/venv.py", line 186, in getcommandpath
    "could not find executable {}".format(pipes.quote(name))
tox.exception.InvocationError: InvocationError for command could not find executable python

A solution might be to setup the same environment as in --current-env, if no environment is there.