diff --git a/.travis-workarounds.sh b/.travis-workarounds.sh new file mode 100755 index 000000000..3f7727376 --- /dev/null +++ b/.travis-workarounds.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -e +set -x + +if [[ "${TOXENV}" == "pypy" ]]; then + sudo add-apt-repository -y ppa:pypy/ppa + sudo apt-get -qy update + sudo apt-get install -y pypy pypy-dev + # This is required because we need to get rid of the Travis installed PyPy + # or it'll take precedence over the PPA installed one. + sudo rm -rf /usr/local/pypy/bin +fi diff --git a/.travis.yml b/.travis.yml index 58db457d8..f2f9c4eb2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,26 +1,21 @@ language: python +python: 2.7 env: - TRAVISBUG="#1027" + - TOXENV=py27 + - TOXENV=precise + - TOXENV=trunk + - TOXENV=pypy + matrix: - exclude: - - env: TRAVISBUG="#1027" - include: - - python: "2.7" - env: BUILDENV=precise - - python: "2.7" - env: BUILDENV=latest - - python: "2.7" - env: BUILDENV=trunk - - python: "pypy" - env: BUILDENV=latest allow_failures: - - python: "pypy" - env: BUILDENV=latest + - env: TOXENV=pypy + install: - - pip install --use-mirrors -r .travis/requirements-$BUILDENV.txt - - pip install --use-mirrors . -script: - - trial scrapy + - ./.travis-workarounds.sh + - pip install -M tox + +script: tox + notifications: irc: channels: diff --git a/.travis/requirements-latest.txt b/.travis/requirements-latest.txt deleted file mode 100644 index 58bd132ef..000000000 --- a/.travis/requirements-latest.txt +++ /dev/null @@ -1,9 +0,0 @@ -pyOpenSSL -lxml -twisted -boto -Pillow -django - -# testing requirements -mock diff --git a/.travis/requirements-precise.txt b/.travis/requirements-precise.txt deleted file mode 100644 index 918dfdc45..000000000 --- a/.travis/requirements-precise.txt +++ /dev/null @@ -1,10 +0,0 @@ -# travis workers uses openssl 1.0 that fails for pyOpenSSL < 0.13 -pyOpenSSL==0.13 -lxml==2.3.2 -twisted==11.1.0 -boto==2.2.2 -Pillow<2.0 -django==1.3.1 - -# testing requirements -mock==1.0.1 diff --git a/.travis/requirements-trunk.txt b/.travis/requirements-trunk.txt deleted file mode 100644 index 482cd91a3..000000000 --- a/.travis/requirements-trunk.txt +++ /dev/null @@ -1,3 +0,0 @@ --r requirements-latest.txt -git+https://github.com/scrapy/w3lib#egg=w3lib -git+https://github.com/scrapy/queuelib#egg=queuelib diff --git a/requirements.txt b/requirements.txt index e79a05122..e070a183e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ Twisted>=10.0.0 -w3lib>=1.2 -queuelib lxml pyOpenSSL cssselect>=0.9 +w3lib>=1.2 +queuelib diff --git a/tox.ini b/tox.ini index fc2327142..56c992aac 100644 --- a/tox.ini +++ b/tox.ini @@ -4,25 +4,40 @@ # and then run "tox" from this directory. [tox] -envlist = py27, precise, trunk +envlist = py27, pypy, precise, trunk [testenv] deps = - -r{toxinidir}/.travis/requirements-latest.txt + -rrequirements.txt + # Extras + boto + Pillow + django + # Only required to run tests + mock commands = - {toxinidir}/bin/runtests.sh [] + trial scrapy [testenv:precise] basepython = python2.7 deps = - -r{toxinidir}/.travis/requirements-precise.txt + pyOpenSSL==0.13 + lxml==2.3.2 + twisted==11.1.0 + boto==2.2.2 + Pillow<2.0 + django==1.3.1 + cssselect==0.9.1 + mock==1.0.1 [testenv:trunk] basepython = python2.7 -deps = - -r{toxinidir}/.travis/requirements-trunk.txt +commands = + pip install https://github.com/scrapy/w3lib/archive/master.zip#egg=w3lib + pip install https://github.com/scrapy/queuelib/archive/master.zip#egg=queuelib + trial scrapy [testenv:windows] commands = - {toxinidir}/bin/runtests.bat [] + bin/runtests.bat [] sitepackages = False