diff --git a/.travis.yml b/.travis.yml index f5785f5039c4d..cfec13f5cf7de 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,8 @@ env: - secure: "TWGKPL4FGtWjCQ427QrSffaQBSCPy1QzPdhtYKAW9AlDo/agdp9RyZRQr8WTlyZ5AOG18X8MDdi0EcpFnyfDNd4thCLyZOntxwltlVV2yNNvnird3XRKUV1F2DD42L64wna04M2KYxpCKhEQ84gEnCH1DGD4g1NnR6fYuEYNSTU=" - secure: "NvgIWe14pv4SJ5BQhw6J0zIpCTFH4fVpzr9pRzM2tD8yf/3cspX3uyXTt4owiqtjoQ3aQGNnhWtVlmSwlgJrwu7KUaE9IPtlsENYDniAj2oJgejjx02d367pHtMB/9e3+4b2fWUsFNJgWw0ordiIT0p1lzHRdQ9ut4l/Yn/lkJs=" - secure: "D3ASNRu32pV79lv/Nl0dBm2ldZiTgbb6boOrN0SzIKsQU3yBwedpqX6EI6KjpVg17lGhhhFXGzL2Gz1qjU3/+m6aMvekxHgpfuc0AlEFCEqenWPxIdDDrUkdfJoCvfQQPd5oxChfHgqaEDLjuqHy1ZEgnJ2/L/6dwZ4fUt62hMk=" + # pandas-docs-bot GH + - secure: "PCzUFR8CHmw9lH84p4ygnojdF7Z8U5h7YfY0RyT+5K/aiQ1ZTU3ZkDTPI0/rR5FVMxsEEKEQKMcc5fvqW0PeD7Q2wRmluloKgT9w4EVEJ1ppKf7lITPcvZR2QgVOvjv4AfDtibLHFNiaSjzoqyJVjM4igjOu8WTlF3JfZcmOQjQ=" matrix: include: @@ -30,6 +32,7 @@ matrix: - FULL_DEPS=true - CLIPBOARD_GUI=gtk2 - JOB_NAME: "27_nslow" # ScatterCI Build name, 20 chars max + - DOC_BUILD=true # if rst files were changed, build docs in parallel with tests - python: 3.2 env: - NOSE_ARGS="not slow" @@ -75,6 +78,7 @@ before_script: script: - echo "script" - ci/script.sh + - if [ -f /tmp/doc.log ]; then cat /tmp/doc.log; fi after_script: - ci/print_versions.py diff --git a/ci/build_docs.sh b/ci/build_docs.sh new file mode 100755 index 0000000000000..583b36857c70c --- /dev/null +++ b/ci/build_docs.sh @@ -0,0 +1,49 @@ +#!/bin/bash + + +cd "$TRAVIS_BUILD_DIR" + +git show --pretty="format:" --name-only HEAD~5.. --first-parent | grep -P "rst|txt|doc" + +if [ "$?" != "0" ]; then + echo "Skipping doc build, none were modified" + # nope, skip docs build + exit 0 +fi + + +if [ x"$DOC_BUILD" != x"" ]; then + # we're running network tests, let's build the docs in the meantim + echo "Will build docs" + pip install sphinx==1.1.3 ipython==1.1.0 + + mv "$TRAVIS_BUILD_DIR"/doc /tmp + cd /tmp/doc + + rm /tmp/doc/source/api.rst # no R + rm /tmp/doc/source/r_interface.rst # no R + + echo ############################### > /tmp/doc.log + echo # Log file for the doc build # > /tmp/doc.log + echo ############################### > /tmp/doc.log + echo "" > /tmp/doc.log + echo -e "y\n" | ./make.py --no-api 2>&1 + + cd /tmp/doc/build/html + git config --global user.email "pandas-docs-bot@localhost.foo" + git config --global user.name "pandas-docs-bot" + + git init + touch README + git add README + git commit -m "Initial commit" --allow-empty + git branch gh-pages + git checkout gh-pages + touch .nojekyll + git add --all . + git commit -m "Version" --allow-empty + git remote add origin https://$GH_TOKEN@github.com/pandas-docs/pandas-docs-travis + git push origin gh-pages -f +fi + +exit 0 diff --git a/ci/install.sh b/ci/install.sh index 53994f2659952..77755a26393c0 100755 --- a/ci/install.sh +++ b/ci/install.sh @@ -98,5 +98,6 @@ export PATH=/usr/lib/ccache:/usr/lib64/ccache:$PATH which gcc ccache -z time pip install $(find dist | grep gz | head -n 1) - +# restore cython +time pip install $PIP_ARGS $(cat ci/requirements-${wheel_box}.txt | grep -i cython) true diff --git a/ci/ironcache/get.py b/ci/ironcache/get.py index 45ce4165cea76..a4663472b955c 100644 --- a/ci/ironcache/get.py +++ b/ci/ironcache/get.py @@ -9,13 +9,16 @@ import base64 from hashlib import sha1 from iron_cache import * +import traceback as tb key='KEY.%s.%s' %(os.environ.get('TRAVIS_REPO_SLUG','unk'), os.environ.get('JOB_NAME','unk')) +print(key) + if sys.version_info[0] > 2: - key = sha1(bytes(key,encoding='utf8')).hexdigest()[:8]+'.' -else: - key = sha1(key).hexdigest()[:8]+'.' + key = bytes(key,encoding='utf8') + +key = sha1(key).hexdigest()[:8]+'.' b = b'' cache = IronCache() @@ -23,8 +26,15 @@ print("getting %s" % key+str(i)) try: item = cache.get(cache="travis", key=key+str(i)) - b += bytes(base64.b64decode(item.value)) - except: + v = item.value + if sys.version_info[0] > 2: + v = bytes(v,encoding='utf8') + b += bytes(base64.b64decode(v)) + except Exception as e: + try: + print(tb.format_exc(e)) + except: + print("exception during exception, oh my") break with open(os.path.join(os.environ.get('HOME',''),"ccache.7z"),'wb') as f: diff --git a/ci/ironcache/put.py b/ci/ironcache/put.py index 0faf173483f23..f6aef3a327e87 100644 --- a/ci/ironcache/put.py +++ b/ci/ironcache/put.py @@ -12,10 +12,15 @@ key='KEY.%s.%s' %(os.environ.get('TRAVIS_REPO_SLUG','unk'), os.environ.get('JOB_NAME','unk')) + +key='KEY.%s.%s' %(os.environ.get('TRAVIS_REPO_SLUG','unk'), + os.environ.get('JOB_NAME','unk')) +print(key) + if sys.version_info[0] > 2: - key = sha1(bytes(key,encoding='utf8')).hexdigest()[:8]+'.' -else: - key = sha1(key).hexdigest()[:8]+'.' + key = bytes(key,encoding='utf8') + +key = sha1(key).hexdigest()[:8]+'.' os.chdir(os.environ.get('HOME')) diff --git a/ci/script.sh b/ci/script.sh index 6980e06fd0217..7632196d783fb 100755 --- a/ci/script.sh +++ b/ci/script.sh @@ -12,5 +12,13 @@ if [ -n "$LOCALE_OVERRIDE" ]; then cd "$curdir" fi +# conditionally build and upload docs to GH/pandas-docs/pandas-docs/travis +"$TRAVIS_BUILD_DIR"/ci/build_docs.sh 2>&1 > /tmp/doc.log & +# doc build log will be shown after tests + echo nosetests -v --exe -w /tmp -A "$NOSE_ARGS" pandas --with-xunit --xunit-file=/tmp/nosetests.xml nosetests -v --exe -w /tmp -A "$NOSE_ARGS" pandas --with-xunit --xunit-file=/tmp/nosetests.xml + + +# wait until subprocesses finish (build_docs.sh) +wait