Skip to content

Commit 3756674

Browse files
committed
CI: add circle ci support
1 parent 0b4fdf9 commit 3756674

7 files changed

+149
-1
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ install:
315315

316316
before_script:
317317
- source activate pandas && pip install codecov
318-
- ci/install_db.sh
318+
- ci/install_db_travis.sh
319319

320320
script:
321321
- echo "script start"

ci/install_circle.sh

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
#!/usr/bin/env bash
2+
3+
home_dir=$(pwd)
4+
echo "[home_dir: $home_dir]"
5+
6+
echo "[ls -ltr]"
7+
ls -ltr
8+
9+
echo "[Using clean Miniconda install]"
10+
rm -rf "$MINICONDA_DIR"
11+
12+
# install miniconda
13+
wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -q -O miniconda.sh || exit 1
14+
bash miniconda.sh -b -p "$MINICONDA_DIR" || exit 1
15+
16+
export PATH="$MINICONDA_DIR/bin:$PATH"
17+
18+
echo "[update conda]"
19+
conda config --set ssl_verify false || exit 1
20+
conda config --set always_yes true --set changeps1 false || exit 1
21+
conda update -q conda
22+
23+
# add the pandas channel to take priority
24+
# to add extra packages
25+
echo "[add channels]"
26+
conda config --add channels pandas || exit 1
27+
conda config --remove channels defaults || exit 1
28+
conda config --add channels defaults || exit 1
29+
30+
# Useful for debugging any issues with conda
31+
conda info -a || exit 1
32+
33+
# support env variables passed
34+
export ENVS_FILE=".envs"
35+
36+
# make sure that the .envs file exists. it is ok if it is empty
37+
touch $ENVS_FILE
38+
39+
# assume all command line arguments are environmental variables
40+
for var in "$@"
41+
do
42+
echo "export $var" >> $ENVS_FILE
43+
done
44+
45+
echo "[environmental variable file]"
46+
cat $ENVS_FILE
47+
source $ENVS_FILE
48+
49+
export REQ_BUILD=ci/requirements-${PYTHON_VERSION}${JOB_TAG}.build
50+
export REQ_RUN=ci/requirements-${PYTHON_VERSION}${JOB_TAG}.run
51+
export REQ_PIP=ci/requirements-${PYTHON_VERSION}${JOB_TAG}.pip
52+
53+
# edit the locale override if needed
54+
if [ -n "$LOCALE_OVERRIDE" ]; then
55+
echo "[Adding locale to the first line of pandas/__init__.py]"
56+
rm -f pandas/__init__.pyc
57+
sedc="3iimport locale\nlocale.setlocale(locale.LC_ALL, '$LOCALE_OVERRIDE')\n"
58+
sed -i "$sedc" pandas/__init__.py
59+
echo "[head -4 pandas/__init__.py]"
60+
head -4 pandas/__init__.py
61+
echo
62+
fi
63+
64+
# create new env
65+
echo "[create env]"
66+
time conda create -q -n pandas python=${PYTHON_VERSION} pytest || exit 1
67+
68+
source activate pandas
69+
70+
# build deps
71+
echo "[build installs: ${REQ_BUILD}]"
72+
time conda install -q --file=${REQ_BUILD} || exit 1
73+
74+
# build but don't install
75+
echo "[build em]"
76+
time python setup.py build_ext --inplace || exit 1
77+
78+
# we may have run installations
79+
echo "[conda installs: ${REQ_RUN}]"
80+
if [ -e ${REQ_RUN} ]; then
81+
time conda install -q --file=${REQ_RUN} || exit 1
82+
fi
83+
84+
# we may have additional pip installs
85+
echo "[pip installs: ${REQ_PIP}]"
86+
if [ -e ${REQ_PIP} ]; then
87+
pip install -q -r $REQ_PIP
88+
fi

ci/install_db_circle.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
echo "installing dbs"
4+
mysql -e 'create database pandas_nosetest;'
5+
psql -c 'create database pandas_nosetest;' -U postgres
6+
7+
echo "done"
8+
exit 0
File renamed without changes.

ci/run_circle.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
3+
echo "[running tests]"
4+
export PATH="$MINICONDA_DIR/bin:$PATH"
5+
6+
source activate pandas
7+
8+
echo "pytest --junitxml=$CIRCLE_TEST_REPORTS/reports/junit.xml $@ pandas"
9+
pytest --junitxml=$CIRCLE_TEST_REPORTS/reports/junit.xml $@ pandas

ci/show_circle.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
echo "[installed versions]"
4+
5+
export PATH="$MINICONDA_DIR/bin:$PATH"
6+
source activate pandas
7+
8+
python -c "import pandas; pandas.show_versions();"

circle.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
machine:
2+
environment:
3+
# these are globally set
4+
MINICONDA_DIR: /home/ubuntu/miniconda3
5+
6+
database:
7+
override:
8+
- ./ci/install_db_circle.sh
9+
10+
checkout:
11+
post:
12+
# since circleci does a shallow fetch
13+
# we need to populate our tags
14+
- git fetch --depth=1000
15+
- git fetch --tags
16+
17+
dependencies:
18+
override:
19+
- >
20+
case $CIRCLE_NODE_INDEX in
21+
0)
22+
sudo apt-get install language-pack-it && ./ci/install_circle.sh PYTHON_VERSION=2.7 JOB_TAG="_COMPAT" LOCALE_OVERRIDE="it_IT.UTF-8" ;;
23+
1)
24+
sudo apt-get install language-pack-zh-hans && ./ci/install_circle.sh PYTHON_VERSION=3.4 JOB_TAG="_SLOW" LOCALE_OVERRIDE="zh_CN.UTF-8" ;;
25+
2)
26+
sudo apt-get install language-pack-zh-hans && ./ci/install_circle.sh PYTHON_VERSION=3.4 JOB_TAG="" LOCALE_OVERRIDE="zh_CN.UTF-8" ;;
27+
3)
28+
./ci/install_circle.sh PYTHON_VERSION=3.5 JOB_TAG="_ASCII" LOCALE_OVERRIDE="C" ;;
29+
esac
30+
- ./ci/show_circle.sh
31+
32+
test:
33+
override:
34+
- case $CIRCLE_NODE_INDEX in 0) ./ci/run_circle.sh --skip-slow --skip-network ;; 1) ./ci/run_circle.sh --only-slow --skip-network ;; 2) ./ci/run_circle.sh --skip-slow --skip-network ;; 3) ./ci/run_circle.sh --skip-slow --skip-network ;; esac:
35+
parallel: true

0 commit comments

Comments
 (0)