Skip to content

CI: add circle ci support #15464

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

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ install:

before_script:
- source activate pandas && pip install codecov
- ci/install_db.sh
- ci/install_db_travis.sh

script:
- echo "script start"
Expand Down
88 changes: 88 additions & 0 deletions ci/install_circle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#!/usr/bin/env bash

home_dir=$(pwd)
echo "[home_dir: $home_dir]"

echo "[ls -ltr]"
ls -ltr

echo "[Using clean Miniconda install]"
rm -rf "$MINICONDA_DIR"

# install miniconda
wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -q -O miniconda.sh || exit 1
bash miniconda.sh -b -p "$MINICONDA_DIR" || exit 1

export PATH="$MINICONDA_DIR/bin:$PATH"

echo "[update conda]"
conda config --set ssl_verify false || exit 1
conda config --set always_yes true --set changeps1 false || exit 1
conda update -q conda

# add the pandas channel to take priority
# to add extra packages
echo "[add channels]"
conda config --add channels pandas || exit 1
conda config --remove channels defaults || exit 1
conda config --add channels defaults || exit 1

# Useful for debugging any issues with conda
conda info -a || exit 1

# support env variables passed
export ENVS_FILE=".envs"

# make sure that the .envs file exists. it is ok if it is empty
touch $ENVS_FILE

# assume all command line arguments are environmental variables
for var in "$@"
do
echo "export $var" >> $ENVS_FILE
done

echo "[environmental variable file]"
cat $ENVS_FILE
source $ENVS_FILE

export REQ_BUILD=ci/requirements-${PYTHON_VERSION}${JOB_TAG}.build
export REQ_RUN=ci/requirements-${PYTHON_VERSION}${JOB_TAG}.run
export REQ_PIP=ci/requirements-${PYTHON_VERSION}${JOB_TAG}.pip

# edit the locale override if needed
if [ -n "$LOCALE_OVERRIDE" ]; then
echo "[Adding locale to the first line of pandas/__init__.py]"
rm -f pandas/__init__.pyc
sedc="3iimport locale\nlocale.setlocale(locale.LC_ALL, '$LOCALE_OVERRIDE')\n"
sed -i "$sedc" pandas/__init__.py
echo "[head -4 pandas/__init__.py]"
head -4 pandas/__init__.py
echo
fi

# create new env
echo "[create env]"
time conda create -q -n pandas python=${PYTHON_VERSION} pytest || exit 1

source activate pandas

# build deps
echo "[build installs: ${REQ_BUILD}]"
time conda install -q --file=${REQ_BUILD} || exit 1

# build but don't install
echo "[build em]"
time python setup.py build_ext --inplace || exit 1

# we may have run installations
echo "[conda installs: ${REQ_RUN}]"
if [ -e ${REQ_RUN} ]; then
time conda install -q --file=${REQ_RUN} || exit 1
fi

# we may have additional pip installs
echo "[pip installs: ${REQ_PIP}]"
if [ -e ${REQ_PIP} ]; then
pip install -q -r $REQ_PIP
fi
8 changes: 8 additions & 0 deletions ci/install_db_circle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

echo "installing dbs"
mysql -e 'create database pandas_nosetest;'
psql -c 'create database pandas_nosetest;' -U postgres

echo "done"
exit 0
File renamed without changes.
9 changes: 9 additions & 0 deletions ci/run_circle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

echo "[running tests]"
export PATH="$MINICONDA_DIR/bin:$PATH"

source activate pandas

echo "pytest --junitxml=$CIRCLE_TEST_REPORTS/reports/junit.xml $@ pandas"
pytest --junitxml=$CIRCLE_TEST_REPORTS/reports/junit.xml $@ pandas
8 changes: 8 additions & 0 deletions ci/show_circle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

echo "[installed versions]"

export PATH="$MINICONDA_DIR/bin:$PATH"
source activate pandas

python -c "import pandas; pandas.show_versions();"
35 changes: 35 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
machine:
environment:
# these are globally set
MINICONDA_DIR: /home/ubuntu/miniconda3

database:
override:
- ./ci/install_db_circle.sh

checkout:
post:
# since circleci does a shallow fetch
# we need to populate our tags
- git fetch --depth=1000
- git fetch --tags

dependencies:
override:
- >
case $CIRCLE_NODE_INDEX in
0)
sudo apt-get install language-pack-it && ./ci/install_circle.sh PYTHON_VERSION=2.7 JOB_TAG="_COMPAT" LOCALE_OVERRIDE="it_IT.UTF-8" ;;
1)
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" ;;
2)
sudo apt-get install language-pack-zh-hans && ./ci/install_circle.sh PYTHON_VERSION=3.4 JOB_TAG="" LOCALE_OVERRIDE="zh_CN.UTF-8" ;;
3)
./ci/install_circle.sh PYTHON_VERSION=3.5 JOB_TAG="_ASCII" LOCALE_OVERRIDE="C" ;;
esac
- ./ci/show_circle.sh

test:
override:
- 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:
parallel: true