Skip to content

CI: Migrate to circleci 2.0 #21814

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
merged 32 commits into from
Aug 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
fc1c4da
CI: Migrate to circleci 2.0
TomAugspurger Jul 8, 2018
f3953ff
fail fast
TomAugspurger Jul 8, 2018
cd588aa
Fixup escaping
TomAugspurger Jul 8, 2018
c6d4d3b
Merge remote-tracking branch 'upstream/master' into circle-2
TomAugspurger Jul 12, 2018
8f9b00c
Update locale setting
TomAugspurger Jul 12, 2018
52e0153
Merge remote-tracking branch 'upstream/master' into circle-2
TomAugspurger Jul 24, 2018
9f1dfda
Update locale setting
TomAugspurger Jul 24, 2018
5b19400
Misc
TomAugspurger Jul 24, 2018
82ce6e4
WIP db
TomAugspurger Jul 24, 2018
ab4fd0d
More database
TomAugspurger Jul 24, 2018
596ad25
move
TomAugspurger Aug 8, 2018
fb8e323
Merge remote-tracking branch 'upstream/master' into circle-2
TomAugspurger Aug 8, 2018
b4c09c6
Merge remote-tracking branch 'upstream/master' into circle-2
TomAugspurger Aug 13, 2018
2329be6
Merge remote-tracking branch 'upstream/master' into circle-2
TomAugspurger Aug 13, 2018
92c1c93
Added skips for s3 non-us locale
TomAugspurger Aug 14, 2018
776066a
remove debug code
TomAugspurger Aug 14, 2018
8220a28
Normalize before comparison in tests
TomAugspurger Aug 14, 2018
5218a11
py2 compat
TomAugspurger Aug 14, 2018
e66e6e4
py2 compat
TomAugspurger Aug 14, 2018
53724a8
py2 compat
TomAugspurger Aug 14, 2018
e41475d
Merge remote-tracking branch 'upstream/master' into circle-2
TomAugspurger Aug 15, 2018
3256cf9
Use .str.normalize
TomAugspurger Aug 15, 2018
12ce1b8
fixups
TomAugspurger Aug 15, 2018
92188c0
fixup
TomAugspurger Aug 15, 2018
132f76a
py2 compat
TomAugspurger Aug 15, 2018
7c231d3
py2 compat
TomAugspurger Aug 15, 2018
96f1faa
py2 compat
TomAugspurger Aug 15, 2018
8d7647c
Fixup
TomAugspurger Aug 15, 2018
11d80dc
py2 compat
TomAugspurger Aug 16, 2018
e621bd0
Merge remote-tracking branch 'upstream/master' into circle-2
TomAugspurger Aug 16, 2018
5748958
fixup
TomAugspurger Aug 16, 2018
03e732f
fixup
TomAugspurger Aug 16, 2018
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
147 changes: 147 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
version: 2
jobs:

# --------------------------------------------------------------------------
# 0. py27_compat
# --------------------------------------------------------------------------
py27_compat:
docker:
- image: continuumio/miniconda:latest
# databases configuration
- image: circleci/postgres:9.6.5-alpine-ram
environment:
POSTGRES_USER: postgres
POSTGRES_DB: pandas_nosetest
- image: circleci/mysql:8-ram
environment:
MYSQL_USER: "root"
MYSQL_HOST: "localhost"
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
MYSQL_DATABASE: "pandas_nosetest"
environment:
JOB: "2.7_COMPAT"
ENV_FILE: "ci/circle-27-compat.yaml"
LOCALE_OVERRIDE: "it_IT.UTF-8"
MINICONDA_DIR: /home/ubuntu/miniconda3
steps:
- checkout
- run:
name: build
command: |
./ci/install_circle.sh
./ci/show_circle.sh
- run:
name: test
command: ./ci/run_circle.sh --skip-slow --skip-network

# --------------------------------------------------------------------------
# 1. py36_locale
# --------------------------------------------------------------------------
py36_locale:
docker:
- image: continuumio/miniconda:latest
# databases configuration
- image: circleci/postgres:9.6.5-alpine-ram
environment:
POSTGRES_USER: postgres
POSTGRES_DB: pandas_nosetest
- image: circleci/mysql:8-ram
environment:
MYSQL_USER: "root"
MYSQL_HOST: "localhost"
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
MYSQL_DATABASE: "pandas_nosetest"

environment:
JOB: "3.6_LOCALE"
ENV_FILE: "ci/circle-36-locale.yaml"
LOCALE_OVERRIDE: "zh_CN.UTF-8"
MINICONDA_DIR: /home/ubuntu/miniconda3
steps:
- checkout
- run:
name: build
command: |
./ci/install_circle.sh
./ci/show_circle.sh
- run:
name: test
command: ./ci/run_circle.sh --skip-slow --skip-network

# --------------------------------------------------------------------------
# 2. py36_locale_slow
# --------------------------------------------------------------------------
py36_locale_slow:
docker:
- image: continuumio/miniconda:latest
# databases configuration
- image: circleci/postgres:9.6.5-alpine-ram
environment:
POSTGRES_USER: postgres
POSTGRES_DB: pandas_nosetest
- image: circleci/mysql:8-ram
environment:
MYSQL_USER: "root"
MYSQL_HOST: "localhost"
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
MYSQL_DATABASE: "pandas_nosetest"

environment:
JOB: "3.6_LOCALE_SLOW"
ENV_FILE: "ci/circle-36-locale_slow.yaml"
LOCALE_OVERRIDE: "zh_CN.UTF-8"
MINICONDA_DIR: /home/ubuntu/miniconda3
steps:
- checkout
- run:
name: build
command: |
./ci/install_circle.sh
./ci/show_circle.sh
- run:
name: test
command: ./ci/run_circle.sh --only-slow --skip-network

# --------------------------------------------------------------------------
# 3. py35_ascii
# --------------------------------------------------------------------------
py35_ascii:
docker:
- image: continuumio/miniconda:latest
# databases configuration
- image: circleci/postgres:9.6.5-alpine-ram
environment:
POSTGRES_USER: postgres
POSTGRES_DB: pandas_nosetest
- image: circleci/mysql:8-ram
environment:
MYSQL_USER: "root"
MYSQL_HOST: "localhost"
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
MYSQL_DATABASE: "pandas_nosetest"

environment:
JOB: "3.5_ASCII"
ENV_FILE: "ci/circle-35-ascii.yaml"
LOCALE_OVERRIDE: "C"
MINICONDA_DIR: /home/ubuntu/miniconda3
steps:
- checkout
- run:
name: build
command: |
./ci/install_circle.sh
./ci/show_circle.sh
- run:
name: test
command: ./ci/run_circle.sh --skip-slow --skip-network


workflows:
version: 2
build_and_test:
jobs:
- py27_compat
- py36_locale
- py36_locale_slow
- py35_ascii
19 changes: 10 additions & 9 deletions ci/install_circle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@ 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"
apt-get update -y && apt-get install -y build-essential postgresql-client-9.6

echo "[update conda]"
conda config --set ssl_verify false || exit 1
Expand Down Expand Up @@ -48,9 +41,17 @@ source $ENVS_FILE

# edit the locale override if needed
if [ -n "$LOCALE_OVERRIDE" ]; then

apt-get update && apt-get -y install locales locales-all

export LANG=$LOCALE_OVERRIDE
export LC_ALL=$LOCALE_OVERRIDE

python -c "import locale; locale.setlocale(locale.LC_ALL, \"$LOCALE_OVERRIDE\")" || exit 1;

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"
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
Expand Down
8 changes: 0 additions & 8 deletions ci/install_db_circle.sh

This file was deleted.

2 changes: 1 addition & 1 deletion ci/run_circle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export PATH="$MINICONDA_DIR/bin:$PATH"
source activate pandas

echo "pytest --strict --junitxml=$CIRCLE_TEST_REPORTS/reports/junit.xml $@ pandas"
pytest --strict --junitxml=$CIRCLE_TEST_REPORTS/reports/junit.xml $@ pandas
pytest --strict --color=no --junitxml=$CIRCLE_TEST_REPORTS/reports/junit.xml $@ pandas
38 changes: 0 additions & 38 deletions circle.yml

This file was deleted.

19 changes: 17 additions & 2 deletions pandas/tests/indexes/datetimes/test_misc.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import locale
import calendar
import unicodedata

import pytest

import numpy as np
import pandas as pd
import pandas.util.testing as tm
from pandas import (Index, DatetimeIndex, datetime, offsets,
date_range, Timestamp)
date_range, Timestamp, compat)


class TestTimeSeries(object):
Expand Down Expand Up @@ -284,10 +285,24 @@ def test_datetime_name_accessors(self, time_locale):
dti = DatetimeIndex(freq='M', start='2012', end='2013')
result = dti.month_name(locale=time_locale)
expected = Index([month.capitalize() for month in expected_months])

# work around different normalization schemes
# https://github.com/pandas-dev/pandas/issues/22342
if not compat.PY2:
result = result.str.normalize("NFD")
expected = expected.str.normalize("NFD")

tm.assert_index_equal(result, expected)

for date, expected in zip(dti, expected_months):
result = date.month_name(locale=time_locale)
assert result == expected.capitalize()
expected = expected.capitalize()

if not compat.PY2:
result = unicodedata.normalize("NFD", result)
expected = unicodedata.normalize("NFD", result)

assert result == expected
dti = dti.append(DatetimeIndex([pd.NaT]))
assert np.isnan(dti.month_name(locale=time_locale)[-1])

Expand Down
2 changes: 2 additions & 0 deletions pandas/tests/io/json/test_compression.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import pandas as pd
import pandas.util.testing as tm
import pandas.util._test_decorators as td
from pandas.util.testing import assert_frame_equal, assert_raises_regex


Expand Down Expand Up @@ -31,6 +32,7 @@ def test_read_zipped_json(datapath):
assert_frame_equal(uncompressed_df, compressed_df)


@td.skip_if_not_us_locale
def test_with_s3_url(compression):
boto3 = pytest.importorskip('boto3')
pytest.importorskip('s3fs')
Expand Down
2 changes: 2 additions & 0 deletions pandas/tests/io/json/test_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
assert_series_equal, network,
ensure_clean, assert_index_equal)
import pandas.util.testing as tm
import pandas.util._test_decorators as td

_seriesd = tm.getSeriesData()
_tsd = tm.getTimeSeriesData()
Expand Down Expand Up @@ -1047,6 +1048,7 @@ def test_read_inline_jsonl(self):
expected = DataFrame([[1, 2], [1, 2]], columns=['a', 'b'])
assert_frame_equal(result, expected)

@td.skip_if_not_us_locale
def test_read_s3_jsonl(self, s3_resource):
# GH17200

Expand Down
2 changes: 2 additions & 0 deletions pandas/tests/io/parser/test_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@ def tips_df(datapath):


@pytest.mark.usefixtures("s3_resource")
@td.skip_if_not_us_locale()
class TestS3(object):

def test_parse_public_s3_bucket(self, tips_df):
pytest.importorskip('s3fs')

# more of an integration test due to the not-public contents portion
# can probably mock this though.
for ext, comp in [('', None), ('.gz', 'gzip'), ('.bz2', 'bz2')]:
Expand Down
1 change: 1 addition & 0 deletions pandas/tests/io/test_excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,7 @@ def test_read_from_http_url(self, ext):
tm.assert_frame_equal(url_table, local_table)

@td.skip_if_no('s3fs')
@td.skip_if_not_us_locale
def test_read_from_s3_url(self, ext):
boto3 = pytest.importorskip('boto3')
moto = pytest.importorskip('moto')
Expand Down
20 changes: 17 additions & 3 deletions pandas/tests/scalar/timestamp/test_timestamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import dateutil
import calendar
import locale
import unicodedata
import numpy as np

from dateutil.tz import tzutc
Expand All @@ -20,7 +21,7 @@
from pandas._libs.tslibs.timezones import get_timezone, dateutil_gettz as gettz

from pandas.errors import OutOfBoundsDatetime
from pandas.compat import long, PY3
from pandas.compat import long, PY3, PY2
from pandas.compat.numpy import np_datetime64_compat
from pandas import Timestamp, Period, Timedelta, NaT

Expand Down Expand Up @@ -116,8 +117,21 @@ def test_names(self, data, time_locale):
expected_day = calendar.day_name[0].capitalize()
expected_month = calendar.month_name[8].capitalize()

assert data.day_name(time_locale) == expected_day
assert data.month_name(time_locale) == expected_month
result_day = data.day_name(time_locale)
result_month = data.month_name(time_locale)

# Work around https://github.com/pandas-dev/pandas/issues/22342
# different normalizations

if not PY2:
expected_day = unicodedata.normalize("NFD", expected_day)
expected_month = unicodedata.normalize("NFD", expected_month)

result_day = unicodedata.normalize("NFD", result_day,)
result_month = unicodedata.normalize("NFD", result_month)

assert result_day == expected_day
assert result_month == expected_month

# Test NaT
nan_ts = Timestamp(NaT)
Expand Down
Loading