Skip to content

Commit 3b865c6

Browse files
authored
TST: configure CircleCI (#232)
Use CircleCI for testing pandas-gbq. This configuration uses the canonical Python and miniconda3 Docker images to reduce problems caused by a unique configuration. Also: * Re-enables conda tests. * Adds Python 3.7 tests.
1 parent b8c9051 commit 3b865c6

12 files changed

+181
-40
lines changed

.circleci/config.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
version: 2
2+
jobs:
3+
# Pip
4+
"pip-2.7-0.19.2":
5+
docker:
6+
- image: python:2.7
7+
environment:
8+
PYTHON: "2.7"
9+
PANDAS: "0.19.2"
10+
steps:
11+
- checkout
12+
- run: ci/config_auth.sh
13+
- run: ci/run_pip.sh
14+
"pip-3.5-0.18.1":
15+
docker:
16+
- image: python:3.5
17+
environment:
18+
PYTHON: "3.5"
19+
PANDAS: "0.18.1"
20+
steps:
21+
- checkout
22+
- run: ci/config_auth.sh
23+
- run: ci/run_pip.sh
24+
"pip-3.6-MASTER":
25+
docker:
26+
- image: python:3.6
27+
environment:
28+
PYTHON: "3.6"
29+
PANDAS: "MASTER"
30+
steps:
31+
- checkout
32+
- run: ci/config_auth.sh
33+
- run: ci/run_pip.sh
34+
# Coverage
35+
- run: codecov
36+
"pip-3.7-0.23.4":
37+
docker:
38+
- image: python:3.7
39+
environment:
40+
PYTHON: "3.7"
41+
PANDAS: "0.23.4"
42+
steps:
43+
- checkout
44+
- run: ci/config_auth.sh
45+
- run: ci/run_pip.sh
46+
47+
# Conda
48+
"conda-3.6-0.20.1":
49+
docker:
50+
- image: continuumio/miniconda3
51+
environment:
52+
PYTHON: "3.6"
53+
PANDAS: "0.20.1"
54+
steps:
55+
- checkout
56+
- run: ci/config_auth.sh
57+
- run: ci/run_conda.sh
58+
59+
lint:
60+
docker:
61+
- image: python:3.6
62+
steps:
63+
- checkout
64+
- run: pip install nox
65+
- run: nox -s lint
66+
workflows:
67+
version: 2
68+
build:
69+
jobs:
70+
- "pip-2.7-0.19.2"
71+
- "pip-3.5-0.18.1"
72+
- "pip-3.6-MASTER"
73+
- "pip-3.7-0.23.4"
74+
- "conda-3.6-0.20.1"
75+
- lint

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,4 @@ Thumbs.db
8989
# Credentials #
9090
###############
9191
bigquery_credentials.dat
92+
ci/service_account.json

ci/config_auth.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
set -e
3+
# Don't set -x, because we don't want to leak keys.
4+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
5+
6+
# Write key to file if present.
7+
if [ ! -z "$SERVICE_ACCOUNT_KEY" ] ; then
8+
echo "$SERVICE_ACCOUNT_KEY" | base64 --decode > "$DIR"/service_account.json
9+
fi

ci/requirements-2.7-0.19.2.pip

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
google-auth
2-
google-auth-oauthlib
3-
PyCrypto
41
mock
5-
google-cloud-bigquery

ci/requirements-3.5-0.18.1.pip

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
google-auth==1.4.1
22
google-auth-oauthlib==0.0.1
3-
google-cloud-bigquery==0.32.0
4-
pandas==0.18.1
3+
google-cloud-bigquery==0.32.0

ci/requirements-3.6-MASTER.pip

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
google-auth
2-
google-auth-oauthlib
3-
git+https://github.com/GoogleCloudPlatform/google-cloud-python.git#egg=version_subpkg&subdirectory=api_core
4-
git+https://github.com/GoogleCloudPlatform/google-cloud-python.git#egg=version_subpkg&subdirectory=core
5-
git+https://github.com/GoogleCloudPlatform/google-cloud-python.git#egg=version_subpkg&subdirectory=bigquery
1+
git+https://github.com/googleapis/google-cloud-python.git#egg=version_subpkg&subdirectory=api_core
2+
git+https://github.com/googleapis/google-cloud-python.git#egg=version_subpkg&subdirectory=core
3+
git+https://github.com/googleapis/google-cloud-python.git#egg=version_subpkg&subdirectory=bigquery

ci/requirements-3.7-0.23.4.pip

Whitespace-only changes.

ci/run_conda.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
set -e -x
3+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
4+
5+
# Install dependencies using Conda
6+
7+
conda config --set always_yes yes --set changeps1 no
8+
conda config --add channels pandas
9+
conda config --add channels conda-forge
10+
conda update -q conda
11+
conda info -a
12+
conda create -q -n test-environment python=$PYTHON
13+
source activate test-environment
14+
if [[ "$PANDAS" == "MASTER" ]]; then
15+
conda install -q numpy pytz python-dateutil;
16+
PRE_WHEELS="https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com";
17+
pip install --pre --upgrade --timeout=60 -f $PRE_WHEELS pandas;
18+
else
19+
conda install -q pandas=$PANDAS;
20+
fi
21+
22+
REQ="ci/requirements-${PYTHON}-${PANDAS}"
23+
conda install -q --file "$REQ.conda";
24+
python setup.py develop
25+
26+
# Run the tests
27+
$DIR/run_tests.sh

ci/run_pip.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
set -e -x
3+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
4+
5+
# Install dependencies using Pip
6+
7+
if [[ "$PANDAS" == "MASTER" ]]; then
8+
PRE_WHEELS="https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com";
9+
pip install --pre --upgrade --timeout=60 -f $PRE_WHEELS pandas;
10+
else
11+
pip install pandas==$PANDAS
12+
fi
13+
14+
# Install test requirements
15+
pip install coverage pytest pytest-cov flake8 codecov
16+
17+
REQ="ci/requirements-${PYTHON}-${PANDAS}"
18+
pip install -r "$REQ.pip"
19+
pip install -e .
20+
21+
$DIR/run_tests.sh

ci/run_tests.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
set -e -x
3+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
4+
5+
if [ -f "$DIR/service_account.json" ]; then
6+
export GOOGLE_APPLICATION_CREDENTIALS="$DIR/service_account.json"
7+
fi
8+
9+
# Install test requirements
10+
pip install coverage pytest pytest-cov flake8 codecov
11+
pytest -v -m "not local_auth" --cov=pandas_gbq --cov-report xml:/tmp/pytest-cov.xml tests

0 commit comments

Comments
 (0)