4

I need 3 env variables in order to install pycurl. When i use Tox, i can't pass my env variables to the Tox environment before it runs the deps installation command.

I already tried using setenv and passenv, but both passes the env variables to the environment after the installation ends. I also can't set the env variables through commands because it says that export command is not found.

This is my tox.ini:

[tox]
envlist = py27
skipsdist = True

[testenv:py27]
deps = -r{toxinidir}/requirements.txt
       -r{toxinidir}/requirements_test.txt

[testenv]
setenv =
    PYTHONPATH = {toxinidir}
    PYTHONHASHSEED = 0
commands = pytest {toxinidir}/tests

My env variables are:

PYCURL_SSL_LIBRARY=openssl
CPPFLAGS=-I/usr/local/opt/openssl/include
LDFLAGS=-L/usr/local/opt/openssl/lib

Thanks in advance

FirEc00l
  • 41
  • 4
  • 1
    You can override [`install_command`](https://tox.readthedocs.io/en/latest/config.html#conf-install_command) with a command or even a script that sets your env variables. – phd Mar 15 '19 at 17:37
  • I already tried it, it does not work – FirEc00l Mar 16 '19 at 23:38
  • 3
    Can you show what you did and how it doesn't work? I'd like to try your code myself. – phd Mar 17 '19 at 00:35

0 Answers0