diff --git a/ci/requirements-3.5.run b/ci/requirements-3.5.run index 43e6814ed6c8e..52828b5220997 100644 --- a/ci/requirements-3.5.run +++ b/ci/requirements-3.5.run @@ -1,4 +1,3 @@ -python-dateutil pytz numpy=1.11.3 openpyxl diff --git a/ci/requirements-3.5.sh b/ci/requirements-3.5.sh index d0f0b81802dc6..917439a8765a2 100644 --- a/ci/requirements-3.5.sh +++ b/ci/requirements-3.5.sh @@ -5,3 +5,7 @@ source activate pandas echo "install 35" conda install -n pandas -c conda-forge feather-format + +# pip install python-dateutil to get latest +conda remove -n pandas python-dateutil --force +pip install python-dateutil diff --git a/ci/requirements-3.6_NUMPY_DEV.run b/ci/requirements-3.6_NUMPY_DEV.run index 0aa987baefb1d..af44f198c687e 100644 --- a/ci/requirements-3.6_NUMPY_DEV.run +++ b/ci/requirements-3.6_NUMPY_DEV.run @@ -1,2 +1 @@ -python-dateutil pytz diff --git a/pandas/tests/tseries/test_offsets.py b/pandas/tests/tseries/test_offsets.py index 47b15a2b66fc4..e03b3e0a85e5e 100644 --- a/pandas/tests/tseries/test_offsets.py +++ b/pandas/tests/tseries/test_offsets.py @@ -4844,7 +4844,7 @@ def test_fallback_plural(self): hrs_pre = utc_offsets['utc_offset_daylight'] hrs_post = utc_offsets['utc_offset_standard'] - if dateutil.__version__ != LooseVersion('2.6.0'): + if dateutil.__version__ < LooseVersion('2.6.0'): # buggy ambiguous behavior in 2.6.0 # GH 14621 # https://github.com/dateutil/dateutil/issues/321 @@ -4852,6 +4852,9 @@ def test_fallback_plural(self): n=3, tstart=self._make_timestamp(self.ts_pre_fallback, hrs_pre, tz), expected_utc_offset=hrs_post) + elif dateutil.__version__ > LooseVersion('2.6.0'): + # fixed, but skip the test + continue def test_springforward_plural(self): # test moving from standard to daylight savings diff --git a/pandas/tests/tseries/test_timezones.py b/pandas/tests/tseries/test_timezones.py index de6978d52968b..c034a9c60ef1b 100644 --- a/pandas/tests/tseries/test_timezones.py +++ b/pandas/tests/tseries/test_timezones.py @@ -552,8 +552,16 @@ def f(): tz=tz, ambiguous='infer') assert times[0] == Timestamp('2013-10-26 23:00', tz=tz, freq="H") - if dateutil.__version__ != LooseVersion('2.6.0'): - # see gh-14621 + if str(tz).startswith('dateutil'): + if dateutil.__version__ < LooseVersion('2.6.0'): + # see gh-14621 + assert times[-1] == Timestamp('2013-10-27 01:00:00+0000', + tz=tz, freq="H") + elif dateutil.__version__ > LooseVersion('2.6.0'): + # fixed ambiguous behavior + assert times[-1] == Timestamp('2013-10-27 01:00:00+0100', + tz=tz, freq="H") + else: assert times[-1] == Timestamp('2013-10-27 01:00:00+0000', tz=tz, freq="H") @@ -1233,13 +1241,18 @@ def test_ambiguous_compat(self): assert result_pytz.value == result_dateutil.value assert result_pytz.value == 1382835600000000000 - # dateutil 2.6 buggy w.r.t. ambiguous=0 - if dateutil.__version__ != LooseVersion('2.6.0'): + if dateutil.__version__ < LooseVersion('2.6.0'): + # dateutil 2.6 buggy w.r.t. ambiguous=0 # see gh-14621 # see https://github.com/dateutil/dateutil/issues/321 assert (result_pytz.to_pydatetime().tzname() == result_dateutil.to_pydatetime().tzname()) assert str(result_pytz) == str(result_dateutil) + elif dateutil.__version__ > LooseVersion('2.6.0'): + # fixed ambiguous behavior + assert result_pytz.to_pydatetime().tzname() == 'GMT' + assert result_dateutil.to_pydatetime().tzname() == 'BST' + assert str(result_pytz) != str(result_dateutil) # 1 hour difference result_pytz = (Timestamp('2013-10-27 01:00:00')