diff options
author | kali <kali@leap.se> | 2012-09-07 04:18:45 +0900 |
---|---|---|
committer | kali <kali@leap.se> | 2012-09-07 05:11:14 +0900 |
commit | c6ec834446cd6772ff900a0637c7296746f53320 (patch) | |
tree | 7df05ee7233a15b2d2153f5e50d5265fcc831938 | |
parent | d3fdb6a4210b47cce9e550694df57621c558a561 (diff) |
tox initial file. using global site-packages because
of the unability to pip install PyQt4.
postmkvenv workaround for PyQt libs for manual use.
pip install breaks because they don't have a standard setup.py
installation process
-rwxr-xr-x | pkg/install_pyqt.sh | 10 | ||||
-rwxr-xr-x | pkg/postmkvenv.sh | 19 | ||||
-rw-r--r-- | tox.ini | 3 |
3 files changed, 31 insertions, 1 deletions
diff --git a/pkg/install_pyqt.sh b/pkg/install_pyqt.sh new file mode 100755 index 00000000..d6739816 --- /dev/null +++ b/pkg/install_pyqt.sh @@ -0,0 +1,10 @@ +#!/bin/sh +pip install sip # fails +cd build/sip +python configure.py +make && make install +cd ../.. +pip install PyQt # fails +cd build/PyQt +python configure.py +make && make install diff --git a/pkg/postmkvenv.sh b/pkg/postmkvenv.sh new file mode 100755 index 00000000..99e364c0 --- /dev/null +++ b/pkg/postmkvenv.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# This hook is run after a new virtualenv is activated. +# ~/.virtualenvs/postmkvirtualenv + +# Symlinks PyQt4 from global installation into virtualenv site-packages + +LIBS=( PyQt4 sip.so ) + +PYTHON_VERSION=python$(python -c "import sys; print (str(sys.version_info[0])+'.'+str(sys.version_info[1]))") +VAR=( $(which -a $PYTHON_VERSION) ) + +GET_PYTHON_LIB_CMD="from distutils.sysconfig import get_python_lib; print (get_python_lib())" +LIB_VIRTUALENV_PATH=$(python -c "$GET_PYTHON_LIB_CMD") +LIB_SYSTEM_PATH=$(${VAR[-1]} -c "$GET_PYTHON_LIB_CMD") + +for LIB in ${LIBS[@]} +do + ln -s $LIB_SYSTEM_PATH/$LIB $LIB_VIRTUALENV_PATH/$LIB +done @@ -4,8 +4,9 @@ envlist = py26,py27,pep8 [testenv] deps = -r{toxinidir}/pkg/requirements.pip -r{toxinidir}/pkg/test-requirements.pip +sitepackages = True commands = nosetests [testenv:pep8] deps = pep8==1.1 -commands = pep8 --repeat --show-source leap setup.py +commands = pep8 --repeat --show-source src/leap setup.py --ignore=E202,W602 --exclude=*_rc.py --repeat |