language: python

python:
  - 2.6
  - 2.7
  - 3.3
  - 3.4
  - 3.5
  - 3.6
  - pypy
  - pypy3

install:
    - python -c "import sys; sys.exit(sys.version_info[:2] != (3,2))" 2>/dev/null || pip install -U pip wheel
    - pip install --install-option="--no-cython-compile" -r requirements.txt
    - pip install -U beautifulsoup4 cssselect

script:
  - python -u setup.py clean
  - CFLAGS="-O0 -g" python -u setup.py build_ext --inplace
  - CFLAGS="-O0 -g" PYTHONUNBUFFERED=x make test

matrix:
  allow_failures:
    - python: pypy
    - python: pypy3

cache:
  directories:
    - $HOME/.cache/pip
