diff --git a/.travis.yml b/.travis.yml index 1cbe55fd..56870495 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,22 +1,50 @@ language: python -python: - - "2.7" +matrix: + include: + - python: "2.7" + virtualenv: + system_site_packages: true + addons: + apt: + packages: + - libusb-dev + - libusb-1.0-0-dev + - libudev-dev + - libffi-dev + - liblua5.2-dev + - libjpeg8-dev + - python-tk + - python-dbus + - pyqt4-dev-tools + - python: "3.4" + addons: + apt: + packages: + - libusb-dev + - libusb-1.0-0-dev + - libudev-dev + - libffi-dev + - liblua5.2-dev + - libjpeg8-dev + - python3-dbus + - python3-pyqt4 + before_install: - - pip install -U setuptools - - sudo add-apt-repository -y ppa:pyside/ppa - - sudo apt-get update -qq - - sudo apt-get install -qq libusb-dev python-pyside libffi-dev libjpeg8-dev libudev-dev libusb-1.0-0-dev python-dbus liblua5.2-dev libusb-dev - - ln -s /usr/lib/python2.7/dist-packages/PySide /usr/lib/python2.7/dist-packages/*dbus* ~/virtualenv/python2.7/lib/python2.7/site-packages/ + - if [[ "$TRAVIS_PYTHON_VERSION" == "3.4" ]]; then + export PYTEST_QT_API=pyqt4 ; + ln -s /usr/lib/python3.2/dist-packages/*dbus* $VIRTUAL_ENV/lib/python$TRAVIS_PYTHON_VERSION/site-packages/ ; + fi + - pip install -U setuptools pytest - "export DISPLAY=:99.0" - "sh -e /etc/init.d/xvfb start" - sleep 3 install: - pip install lupa --install-option='--no-luajit' - - pip install cffi flake8 pyflakes pep8-naming + - pip install cffi flake8 pep8-naming flake8-putty - pip install -e ".[web,hidtrigger,autorotate,chdkcamera]" - pip install -r test-requirements.txt - pip install -e . script: - flake8 spreads spreadsplug tests --exclude=vendor - - py.test --cov spreads --cov spreadsplug -m "not guitest" tests + - if [[ $TRAVIS_PYTHON_VERSION != "3.4" ]]; then py.test --cov spreads --cov spreadsplug -m "not guitest" tests ; fi after_success: coveralls diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..d3174c65 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,4 @@ +[flake8] +putty-ignore = + python_version > "3" , /(raw_input|unicode|basestring)/ : +F821 + python_version > "3" , spreadsplug/ , tests/ : +F821 diff --git a/spreadsplug/dev/dummy.py b/spreadsplug/dev/dummy.py index 8f3d7431..179a7f64 100644 --- a/spreadsplug/dev/dummy.py +++ b/spreadsplug/dev/dummy.py @@ -104,4 +104,4 @@ def update_configuration(self, updated): pass def show_textbox(self, msg): - print "DISPLAY ON {0} device:\n{1}".format(self.target_page, msg) + print("DISPLAY ON {0} device:\n{1}".format(self.target_page, msg)) diff --git a/test-requirements.txt b/test-requirements.txt index acff358a..99101476 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,7 +2,7 @@ pytest-qt >= 1.0 pytest-cov >= 1.6 pytest >= 2.5.1 coveralls >= 0.2 -sphinxcontrib-fulltoc==1.0 +sphinxcontrib-fulltoc>=1.0 mock>=1.0.1 coverage>=3.6 psutil==2.0.0 diff --git a/tests/cli_test.py b/tests/cli_test.py index ecb8cc25..d5642dea 100644 --- a/tests/cli_test.py +++ b/tests/cli_test.py @@ -102,7 +102,7 @@ def test_configure(config, mock_input, mock_getch): TestDriver.num_devices = 2 - print config['plugins'].get() + print(config['plugins'].get()) assert config['driver'].get() == 'testdriver' assert config['plugins'].get() == ["test_process", "test_output"] assert config["device"]["focus_distance"].get() == 300