From 976203dd3490c088a48127ff66e4997af09d85ef Mon Sep 17 00:00:00 2001 From: Pierre Glaser Date: Thu, 7 Mar 2019 15:03:30 +0100 Subject: [PATCH] CI test cloudpickle against python3.8 with hooks --- .travis.yml | 75 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 47 insertions(+), 28 deletions(-) diff --git a/.travis.yml b/.travis.yml index bdd338040..5b3f6cbc4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,23 +3,26 @@ dist: xenial matrix: include: - - os: windows - language: sh - env: PYTHON_ROOT="/c/Python37" PYTHON_CHOCO_PKG="python3" - - os: windows - language: sh - env: PYTHON_ROOT="/c/Python27" PYTHON_CHOCO_PKG="python2" + # - os: windows + # language: sh + # env: PYTHON_ROOT="/c/Python37" PYTHON_CHOCO_PKG="python3" + # - os: windows + # language: sh + # env: PYTHON_ROOT="/c/Python27" PYTHON_CHOCO_PKG="python2" + # - os: linux + # dist: trusty + # python: "pypy3" + # - os: linux + # python: 3.7 + # - os: linux + # python: 3.6 + # - os: linux + # python: 3.5 + # - os: linux + # python: 2.7 - os: linux - dist: trusty - python: "pypy3" - - os: linux - python: 3.7 - - os: linux - python: 3.6 - - os: linux - python: 3.5 - - os: linux - python: 2.7 + # running python 3.8 + env: BUILD_PY_FROM_SOURCE=1 - os: linux # The PROJECT environment variable refers to a downstream project that # depends on cloudpickle (for example: distributed, joblib, loky). For @@ -54,15 +57,31 @@ before_install: export PATH="$PYTHON_ROOT:$PYTHON_ROOT/Scripts:$PATH"; python -m pip install --upgrade pip; fi + - if [[ "$BUILD_PY_FROM_SOURCE" == 1 ]]; then + export VENV_DIR="$HOME/python38"; + pushd ..; + git clone https://github.com/pierreglaser/cpython.git; + pushd cpython; + git checkout add-global-hook; + ./configure; + make; + ./python -m venv "$VENV_DIR"; + popd; + popd; + export PYTHON_EXE="$VENV_DIR/bin/python"; + else + export PYTHON_EXE="python"; + fi + install: - - pip install . - - pip install --upgrade -r dev-requirements.txt - - pip install tornado - - if [[ $TRAVIS_PYTHON_VERSION != 'pypy'* ]]; then - pip install numpy scipy; + - $PYTHON_EXE -m pip install . + - $PYTHON_EXE -m pip install --upgrade -r dev-requirements.txt + - $PYTHON_EXE -m pip install tornado + - if [[ $TRAVIS_PYTHON_VERSION != 'pypy'* && "$BUILD_PY_FROM_SOURCE" != 1 ]]; then + $PYTHON_EXE -m pip install numpy scipy; fi - if [[ $PROJECT != "" ]]; then - pip install $TEST_REQUIREMENTS; + $PYTHON_EXE -m pip install $TEST_REQUIREMENTS; pushd ..; git clone $PROJECT_URL; if [[ $PROJECT == "joblib" ]]; then @@ -70,18 +89,18 @@ install: source vendor_cloudpickle.sh ../../../cloudpickle; popd; fi; - pip install ./$PROJECT; + $PYTHON_EXE -m pip install ./$PROJECT; popd; fi - - pip list + - $PYTHON_EXE -m pip list before_script: # stop the build if there are Python syntax errors or undefined names - - flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics + - $PYTHON_EXE -m flake8 . --count --verbose --select=E901,E999,F821,F822,F823 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - python ci/install_coverage_subprocess_pth.py + - $PYTHON_EXE -m flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - $PYTHON_EXE ci/install_coverage_subprocess_pth.py script: - - COVERAGE_PROCESS_START="$TRAVIS_BUILD_DIR/.coveragerc" PYTHONPATH='.:tests' pytest -r s + - COVERAGE_PROCESS_START="$TRAVIS_BUILD_DIR/.coveragerc" PYTHONPATH='.:tests' $PYTHON_EXE -m pytest -r s - | if [[ $PROJECT != "" ]]; then pushd ../$PROJECT