Exclude tools and events from python2 tests and packaging
Those two parts require python3. To avoid duplicating the exclude list, run tests and pylint on a copy installed via setuptools.
This commit is contained in:
parent
d0e8c0515e
commit
7bafd631d4
@ -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
|
||||
|
2
Makefile
2
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)
|
||||
|
@ -73,4 +73,4 @@ class QubesTestCase(unittest.TestCase):
|
||||
def assertAllCalled(self):
|
||||
self.assertEqual(
|
||||
set(self.app.expected_calls.keys()),
|
||||
set(self.app.actual_calls))
|
||||
set(self.app.actual_calls))
|
||||
|
@ -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}
|
||||
|
||||
|
||||
|
@ -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 "$@"
|
||||
|
7
setup.py
7
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',
|
||||
|
Loading…
Reference in New Issue
Block a user