se7entyse7en se7entyse7en - 6 months ago 27
Python Question

Python tox dependencies installation output

Is it possibile with

tox
to avoid the redirect of the output to a file when installing dependencies with
pip
? I want to see what's being installed so I would like to log to stdout instead of a file.

Answer

I solved by adding the changing the install_command in the tox.ini as follows:

install_command = ./install_deps {opts} {packages}

where install_deps is:

#!/bin/sh
# This script is used as `install_command` for `tox` in order to log to stdout
# the requirements that are being installed.

pip install $@ | tee /dev/tty