Skip to content

BLD: Build and publish docs (sans API) as part of Travis jobs #6233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
2 commits merged into from Feb 2, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand Down
49 changes: 49 additions & 0 deletions ci/build_docs.sh
Original file line number Diff line number Diff line change
@@ -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 "[email protected]"
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://[email protected]/pandas-docs/pandas-docs-travis
git push origin gh-pages -f
fi

exit 0
3 changes: 2 additions & 1 deletion ci/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
20 changes: 15 additions & 5 deletions ci/ironcache/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,32 @@
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()
for i in range(20):
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:
Expand Down
11 changes: 8 additions & 3 deletions ci/ironcache/put.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))

Expand Down
8 changes: 8 additions & 0 deletions ci/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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