From c9958dee8ef23f20d99e21fb6a580c1b2c9d594a Mon Sep 17 00:00:00 2001 From: kali Date: Thu, 6 Sep 2012 06:32:16 +0900 Subject: tox ini file --- tox.ini | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tox.ini diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..cb010626 --- /dev/null +++ b/tox.ini @@ -0,0 +1,11 @@ +[tox] +envlist = py26,py27,pep8 + +[testenv] +deps = -r{toxinidir}/pkg/requirements.pip + -r{toxinidir}/pkg/test-requirements.pip +commands = nosetests + +[testenv:pep8] +deps = pep8==1.1 +commands = pep8 --repeat --show-source leap setup.py -- cgit v1.2.3 From d3fdb6a4210b47cce9e550694df57621c558a561 Mon Sep 17 00:00:00 2001 From: kali Date: Thu, 6 Sep 2012 07:01:12 +0900 Subject: add pkg to sdist --- MANIFEST.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 856d95ef..ff80c7e4 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,3 @@ -# ??? not needed from win -include pkg/linux/polkit/* +include pkg/* include docs/* include pkg/RELEASE_VERSION -- cgit v1.2.3 From c6ec834446cd6772ff900a0637c7296746f53320 Mon Sep 17 00:00:00 2001 From: kali Date: Fri, 7 Sep 2012 04:18:45 +0900 Subject: 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 --- pkg/install_pyqt.sh | 10 ++++++++++ pkg/postmkvenv.sh | 19 +++++++++++++++++++ tox.ini | 3 ++- 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100755 pkg/install_pyqt.sh create mode 100755 pkg/postmkvenv.sh 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 diff --git a/tox.ini b/tox.ini index cb010626..bf4d8fb6 100644 --- a/tox.ini +++ b/tox.ini @@ -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 -- cgit v1.2.3 From 5006fda226a3fa6afda231df8aa733477bd4e420 Mon Sep 17 00:00:00 2001 From: kali Date: Fri, 7 Sep 2012 05:20:41 +0900 Subject: update README with tox info and PyQt annoyances --- README.txt | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/README.txt b/README.txt index a7c03f80..28971255 100644 --- a/README.txt +++ b/README.txt @@ -23,27 +23,31 @@ apt-get install python-qt4 python-qt4-doc pyqt4-dev-tools python-setuptools pyth Install --------------- -If not using virtualenv: +Global install: sudo python setup.py install If using virtualenv: python setup.py install +Install PyQt +------------ +pip install PyQt will fail because PyQt4 does not use the standard setup.py mechanism. +Instead, they use configure.py which generates a Makefile. -Running the App ------------------ +python configure.py +make && make install -You need to set up a provider in your eip.cfg file: +You can: -cd ~/.config/leap -vim eip.cfg +* install PyQt globally and make a virtualenv with --site-packages +* run pkg/install_pyqt.sh inside your virtualenv (with --no-site-packages) +* run pkg/postmkvenv.sh after creating your virtualenv, for making symlinks to your global PyQt installation. -[provider] -remote_ip = XXX.XXX.XXX.XXX -and then run: +Running the App +----------------- -leap --debug +leap --debug --logfile /tmp/leap.log (or python app.py --debug if you run it from the src/leap folder). @@ -66,6 +70,11 @@ or nosetests leap.util.test_leap_argparse +Tox +--- +For running testsuite against all the supported python versions (currently 2.6 and 2.7), run: + +tox -v Test-deps --------- @@ -78,14 +87,9 @@ Hack (recommended) virtualenv . # ensure your .gitignore knows about it bin/activate - -# you should probably simlink sip.so and PyQt4 to your system-wide -# install, there are some issues with it. - +pkg/postmkvenv.sh python setup.py develop -# ... TBD: finish develop howto. -# ... and explain how is python setup develop useful. Compiling resource/ui files ----------------------------- -- cgit v1.2.3