diff options
-rw-r--r-- | README.rst | 3 | ||||
-rw-r--r-- | changes/feature_ci-ready | 1 | ||||
-rw-r--r-- | pkg/install_venv.py (renamed from pkg/scripts/install_venv.py) | 4 | ||||
-rw-r--r-- | pkg/requirements-testing.pip | 13 | ||||
-rw-r--r-- | pkg/requirements.pip | 10 | ||||
-rwxr-xr-x | run_tests.sh | 18 | ||||
-rwxr-xr-x | setup.py | 8 | ||||
-rw-r--r-- | src/leap/gui/__init__.py | 21 | ||||
-rw-r--r-- | tox.ini | 12 |
9 files changed, 69 insertions, 21 deletions
@@ -3,6 +3,9 @@ The LEAP Encryption Access Project Client *your internet encryption toolkit* +.. image:: https://pypip.in/v/leap-client/badge.png + :target: https://crate.io/packages/leap.client + Dependencies ------------------ diff --git a/changes/feature_ci-ready b/changes/feature_ci-ready new file mode 100644 index 00000000..9cd343c4 --- /dev/null +++ b/changes/feature_ci-ready @@ -0,0 +1 @@ + o Update test suite, run_scripts and requirements to run smoothly with buildbot. diff --git a/pkg/scripts/install_venv.py b/pkg/install_venv.py index 17dfb984..80bc5d4b 100644 --- a/pkg/scripts/install_venv.py +++ b/pkg/install_venv.py @@ -30,7 +30,7 @@ import sys ROOT = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) VENV = os.path.join(ROOT, '.venv') PIP_REQUIRES = os.path.join(ROOT, 'pkg', 'requirements.pip') -TEST_REQUIRES = os.path.join(ROOT, 'pkg', 'test-requirements.pip') +TEST_REQUIRES = os.path.join(ROOT, 'pkg', 'requirements-testing.pip') PY_VERSION = "python%s.%s" % (sys.version_info[0], sys.version_info[1]) @@ -167,7 +167,7 @@ def create_virtualenv(venv=VENV, no_site_packages=True): """ print 'Creating venv...', if no_site_packages: - #setuptools and virtualenv don't play nicely together, + #setuptools and virtualenv don't play nicely together, #so we create the virtualenv with the distribute package instead. #See: view-source:http://pypi.python.org/pypi/distribute run_command(['virtualenv', '-q', '--distribute', '--no-site-packages', VENV]) diff --git a/pkg/requirements-testing.pip b/pkg/requirements-testing.pip index bfa20544..5405a75b 100644 --- a/pkg/requirements-testing.pip +++ b/pkg/requirements-testing.pip @@ -1,13 +1,18 @@ nose nose-exclude nose-progressive -mock + + unittest2 # TODO we should include this dep only for python2.6 coverage pep8==1.1 +tox #sphinx>=1.1.2 -#tox -twisted -zope.interface +# double reqs +# (the client already includes, which gives some errors) +# ----------- +# mock # re-add XXX +#twisted +#zope.interface diff --git a/pkg/requirements.pip b/pkg/requirements.pip index 5f69abfb..a7713ec4 100644 --- a/pkg/requirements.pip +++ b/pkg/requirements.pip @@ -1,11 +1,11 @@ # in order of addition to the project. -# do not change the ordering. +# try not to change the ordering. # -argparse -# -PySide +# PySide -- It's a requirement indeed, but +# it gives troubles when operating inside virtualenvs. # Use LEAP_VENV_SKIP_PYSIDE to avoid installing it! +argparse requests srp>=1.0.2 pyopenssl @@ -16,7 +16,7 @@ ipaddr twisted qt4reactor -leap.common>=0.2.4 +leap.common>=0.2.5 leap.soledad>=0.1.0 # Remove this when nickserver is online diff --git a/run_tests.sh b/run_tests.sh index fccf6b3f..500cf53c 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -64,7 +64,7 @@ done # If enabled, tell nose to collect coverage data if [ $coverage -eq 1 ]; then - noseopts="$noseopts --with-coverage --cover-package=leap-client" + noseopts="$noseopts --with-coverage --cover-package=leap" fi if [ $no_site_packages -eq 1 ]; then @@ -74,7 +74,7 @@ fi # If alltests flag is not set, let's exclude some dirs that are troublesome. if [ $alltests -eq 0 ]; then echo "[+] Running ALL tests..." - #noseopts="$noseopts --exclude-dir=src/leap/exclude-me" + #noseopts="$noseopts --exclude-dir=leap/soledad" fi # If progressive flag enabled, run with this nice plugin :) @@ -84,7 +84,9 @@ fi function run_tests { + echo "running tests..." # Just run the test suites in current environment + echo "NOSETESTS=$NOSETESTS" ${wrapper} $NOSETESTS # If we get some short import error right away, print the error log directly RESULT=$? @@ -103,7 +105,9 @@ function run_pep8 { # in the current debhelper build process, # so I exclude the topmost tests -NOSETESTS="nosetests leap $noseopts $noseargs" +#NOSETESTS="nosetests leap --exclude=soledad* $noseopts $noseargs" +NOSETESTS="$VIRTUAL_ENV/bin/nosetests . $noseopts $noseargs" +#--with-coverage --cover-package=leap" if [ $never_venv -eq 0 ] then @@ -150,9 +154,11 @@ if [ -z "$noseargs" ]; then fi function run_coverage { - cov_opts="--omit=`pwd`/src/leap/base/tests/*,`pwd`/src/leap/eip/tests/*,`pwd`/src/leap/gui/tests/*" - cov_opts="$cov_opts,`pwd`/src/leap/util/tests/* " - cov_opts="$cov_opts --include=`pwd`/src/leap/*" #,`pwd`/src/leap/eip/*" + cov_opts="--include=`pwd`/src/leap/*" #,`pwd`/src/leap/eip/*" + cov_opts="$cov_opts --omit=`pwd`/src/leap/gui/ui_*,`pwd`/src/leap/gui/*_rc.py*" + #cov_opts="--omit=`pwd`/src/leap/base/tests/*,`pwd`/src/leap/eip/tests/*,`pwd`/src/leap/gui/tests/*" + #cov_opts="$cov_opts,`pwd`/src/leap/util/tests/* " + #cov_opts="$cov_opts --include=`pwd`/src/leap/*" #,`pwd`/src/leap/eip/*" ${wrapper} coverage html -d docs/covhtml -i $cov_opts echo "now point your browser at docs/covhtml/index.html" } @@ -65,10 +65,10 @@ setup( classifiers=trove_classifiers, install_requires=utils.parse_requirements(), # Uncomment when tests are done - # test_suite='nose.collector', - # test_requires=utils.parse_requirements( - # reqfiles=['pkg/test-requirements.pip']), - keywords='LEAP, client, qt, encryption, proxy, openvpn', + test_suite='nose.collector', + test_requires=utils.parse_requirements( + reqfiles=['pkg/requirements-testing.pip']), + keywords='LEAP, client, qt, encryption, proxy, openvpn, imap, smtp', author='The LEAP Encryption Access Project', author_email='info@leap.se', url='https://leap.se', diff --git a/src/leap/gui/__init__.py b/src/leap/gui/__init__.py index e69de29b..d31dac64 100644 --- a/src/leap/gui/__init__.py +++ b/src/leap/gui/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# __init__.py +# Copyright (C) 2013 LEAP +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +""" +init file for leap.gui +""" +from .. import app +__all__ = [app] diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..e041515d --- /dev/null +++ b/tox.ini @@ -0,0 +1,12 @@ +[tox] +envlist = py26,py27 + +[testenv] +deps = -r{toxinidir}/pkg/requirements.pip + -r{toxinidir}/pkg/requirements-testing.pip +sitepackages = True +commands = xvfb-run nosetests leap --first-package-wins --exclude=soledad* + +[testenv:pep8] +deps = pep8==1.1 +commands = pep8 --repeat --show-source src/leap setup.py --ignore=E202,W602 --exclude=*_rc.py --repeat |