How to add boot tray script to tox virtualenv?

I need psycopg2 and lxml for my tests, but when I try to install it in virtualenv via tox, it fails due to the lack of pg_conf or other dependencies.

I found this explanation of boot scripts: http://www.virtualenv.org/en/latest/index.html#bootstrap-example

How to add boot script file to use virtualenv? Do you know good examples of my problems (lxml and psycopg2)?

+4
source share
1 answer

I don't think you can use boot scripts (as described in virtualenv docs) with tox. However, you can configure your tox.ini file to install Python dependencies that are not specified in setup.py , and run arbitrary commands before running the tests. On the toxin homepage:

 # content of: tox.ini , put in same dir as setup.py [tox] envlist = py26,py27 [testenv] deps=pytest # install pytest in the venvs commands=py.test # or 'nosetests' or ... 

deps and commands are actually lists:

 deps= lxml psycopg2 pytest commands= ./some_other_script.sh py.test 

But forget about boot scripts and take a step back. What is the original problem with pg_conf?

+4
source

Source: https://habr.com/ru/post/1445049/


All Articles