How to run bash commands in a tox.ini command

22 views Asked by At

Having a testenv in a tox.ini file, how do we execute bash commands?

[testenv:testenv_name]
description = testenv_description.
commands =
    export ABC="123"
    echo $ABC
1

There are 1 answers

1
kendallbp On

Partial answer: Add the line allowlist_externals = /bin/bash. Then for calling the bash "commands", use /bin/ before the atual command; e.g.: /bin/echo.

Example:

[testenv:testenv_name]
description = testenv_description.
allowlist_externals = /bin/bash
commands =
    /bin/touch deleteme.txt
    /bin/echo -e "123\n456"

However commands such as export do not seem to work.