diff --git a/.travis.yml b/.travis.yml index 82fd84d..5a264e4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,8 +9,9 @@ install: - pip install --quiet -r ci/requirements.txt - git clone https://github.com/"${TRAVIS_REPO_SLUG%%/*}"/qubes-builder ~/qubes-builder script: - - test -z "$TESTS_ONLY" || PYTHONPATH=test-packages pylint --rcfile=ci/pylintrc qubesmgmt - - test -z "$TESTS_ONLY" || ./run-tests + - test -z "$TESTS_ONLY" || python setup.py build + - test -z "$TESTS_ONLY" || { cd build/lib; PYTHONPATH=../../test-packages pylint --rcfile=../../ci/pylintrc qubesmgmt; } + - test -z "$TESTS_ONLY" || { cd build/lib; ROOTDIR=../.. ../../run-tests; } - test -n "$TESTS_ONLY" || ~/qubes-builder/scripts/travis-build env: - TESTS_ONLY=1 diff --git a/Makefile b/Makefile index cf4a533..ecfa5be 100644 --- a/Makefile +++ b/Makefile @@ -9,4 +9,4 @@ build: .PHONY: install install: - $(PYTHON) setup.py install -O1 --skip-build $(PYTHON_PREFIX_ARG) --root $(DESTDIR) + $(PYTHON) setup.py install -O1 $(PYTHON_PREFIX_ARG) --root $(DESTDIR) diff --git a/qubesmgmt/tests/__init__.py b/qubesmgmt/tests/__init__.py index 6e93537..26b2e06 100644 --- a/qubesmgmt/tests/__init__.py +++ b/qubesmgmt/tests/__init__.py @@ -73,4 +73,4 @@ class QubesTestCase(unittest.TestCase): def assertAllCalled(self): self.assertEqual( set(self.app.expected_calls.keys()), - set(self.app.actual_calls)) \ No newline at end of file + set(self.app.actual_calls)) diff --git a/rpm_spec/qubes-core-mgmt-client.spec b/rpm_spec/qubes-core-mgmt-client.spec index 6d0a38a..72856f9 100644 --- a/rpm_spec/qubes-core-mgmt-client.spec +++ b/rpm_spec/qubes-core-mgmt-client.spec @@ -40,12 +40,11 @@ Python3 module qubesmgmt. %build -make %{?_smp_mflags} PYTHON=%{__python2} -make %{?_smp_mflags} PYTHON=%{__python3} - %install +rm -rf build %make_install PYTHON=%{__python2} +rm -rf build %make_install PYTHON=%{__python3} diff --git a/run-tests b/run-tests index 6ac1513..a1ff989 100755 --- a/run-tests +++ b/run-tests @@ -1,10 +1,13 @@ #!/bin/sh : "${PYTHON:=python}" -: "${TESTPYTHONPATH:=test-packages}" +: "${ROOTDIR:=.}" +: "${TESTPYTHONPATH:=$ROOTDIR/test-packages}" PYTHONPATH="${TESTPYTHONPATH}:${PYTHONPATH}" export PYTHONPATH -"${PYTHON}" setup.py egg_info --egg-base "${TESTPYTHONPATH}" -"${PYTHON}" -m coverage run --rcfile=ci/coveragerc -m unittest discover -p '*.py' -v "$@" +[ -r version ] || ln -s ${ROOTDIR}/version ./ +[ -r setup.py ] || ln -s ${ROOTDIR}/setup.py ./ +"${PYTHON}" ./setup.py egg_info --egg-base "${TESTPYTHONPATH}" +"${PYTHON}" -m coverage run --rcfile=$ROOTDIR/ci/coveragerc -m unittest discover -s qubesmgmt/tests -p '*.py' -v "$@" diff --git a/setup.py b/setup.py index d86d851..c233f8b 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,11 @@ # vim: fileencoding=utf-8 import setuptools +import sys + +exclude=[] +if sys.version_info[0:2] < (3, 5): + exclude = ['qubesmgmt.events', 'qubesmgmt.tools', 'qubesmgmt.tests.tools'] if __name__ == '__main__': setuptools.setup( @@ -11,7 +16,7 @@ if __name__ == '__main__': description='Qubes mgmt API package', license='LGPL2.1+', url='https://www.qubes-os.org/', - packages=setuptools.find_packages(), + packages=setuptools.find_packages(exclude=exclude), entry_points={ 'qubesmgmt.vm': [ 'AppVM = qubesmgmt.vm:AppVM',