Skip to content

Commit 371a257

Browse files
committed
BLD: require python-dateutil>=2.5.0
1 parent 73ed6de commit 371a257

File tree

10 files changed

+29
-31
lines changed

10 files changed

+29
-31
lines changed

ci/requirements-2.7.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
python=2.7*
2-
python-dateutil=2.4.1
2+
python-dateutil=2.5.0
33
pytz=2013b
44
nomkl
55
numpy

ci/requirements-2.7.run

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
python-dateutil=2.4.1
1+
python-dateutil=2.5.0
22
pytz=2013b
33
numpy
44
xlwt=0.7.5

ci/requirements-2.7_COMPAT.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
python=2.7*
22
numpy=1.9.2
33
cython=0.23
4-
dateutil=1.5
4+
python-dateutil=2.5.0
55
pytz=2013b

ci/requirements-2.7_COMPAT.run

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
numpy=1.9.2
2-
dateutil=1.5
2+
python-dateutil=2.5.0
33
pytz=2013b
44
scipy=0.14.0
55
xlwt=0.7.5

conda.recipe/meta.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ requirements:
2222
run:
2323
- python
2424
- numpy x.x
25-
- python-dateutil
25+
- python-dateutil >=2.5.0
2626
- pytz
2727

2828
test:

doc/source/install.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ Dependencies
200200

201201
* `setuptools <https://setuptools.readthedocs.io/en/latest/>`__
202202
* `NumPy <http://www.numpy.org>`__: 1.9.0 or higher
203-
* `python-dateutil <http://labix.org/python-dateutil>`__: 1.5 or higher
203+
* `python-dateutil <//https://dateutil.readthedocs.io/en/stable/>`__: 2.5 or higher
204204
* `pytz <http://pytz.sourceforge.net/>`__: Needed for time zone support
205205

206206
.. _install.recommended_dependencies:

doc/source/whatsnew/v0.22.0.txt

+13-1
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,20 @@ Backwards incompatible API changes
8686
- :func:`Series.fillna` now raises a ``TypeError`` instead of a ``ValueError`` when passed a list, tuple or DataFrame as a ``value`` (:issue:`18293`)
8787
- :func:`pandas.DataFrame.merge` no longer casts a ``float`` column to ``object`` when merging on ``int`` and ``float`` columns (:issue:`16572`)
8888
- The default NA value for :class:`UInt64Index` has changed from 0 to ``NaN``, which impacts methods that mask with NA, such as ``UInt64Index.where()`` (:issue:`18398`)
89-
-
9089

90+
Dependencies have increased minimum versions
91+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
92+
93+
We have updated our minimum supported versions of dependencies ().
94+
If installed, we now require:
95+
96+
+-----------------+-----------------+----------+
97+
| Package | Minimum Version | Required |
98+
+=================+=================+==========+
99+
| python-dateutil | 2.5.0 | X |
100+
+-----------------+-----------------+----------+
101+
102+
- :func:`Series.fillna` now raises a ``TypeError`` instead of a ``ValueError`` when passed a list, tuple or DataFrame as a ``value`` (:issue:`18293`)
91103

92104

93105

pandas/compat/__init__.py

+4-16
Original file line numberDiff line numberDiff line change
@@ -396,25 +396,13 @@ def raise_with_traceback(exc, traceback=Ellipsis):
396396
If traceback is not passed, uses sys.exc_info() to get traceback."""
397397

398398

399-
# http://stackoverflow.com/questions/4126348
400-
# Thanks to @martineau at SO
401-
399+
# dateutil minimum version
402400
import dateutil
403401

404-
if PY2 and LooseVersion(dateutil.__version__) == '2.0':
405-
# dateutil brokenness
406-
raise Exception('dateutil 2.0 incompatible with Python 2.x, you must '
407-
'install version 1.5 or 2.1+!')
408-
402+
if LooseVersion(dateutil.__version__) < '2.5':
403+
raise ImportError('dateutil 2.5.0 is the minimum required version')
409404
from dateutil import parser as _date_parser
410-
if LooseVersion(dateutil.__version__) < '2.0':
411-
412-
@functools.wraps(_date_parser.parse)
413-
def parse_date(timestr, *args, **kwargs):
414-
timestr = bytes(timestr)
415-
return _date_parser.parse(timestr, *args, **kwargs)
416-
else:
417-
parse_date = _date_parser.parse
405+
parse_date = _date_parser.parse
418406

419407

420408
# https://github.com/pandas-dev/pandas/pull/9123

pandas/tests/indexes/datetimes/test_tools.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1160,9 +1160,9 @@ class TestDatetimeParsingWrappers(object):
11601160
@pytest.mark.parametrize('cache', [True, False])
11611161
def test_parsers(self, cache):
11621162

1163+
# dateutil >= 2.5.0 defaults to yearfirst=True
11631164
# https://github.com/dateutil/dateutil/issues/217
1164-
import dateutil
1165-
yearfirst = dateutil.__version__ >= LooseVersion('2.5.0')
1165+
yearfirst = True
11661166

11671167
cases = {'2011-01-01': datetime(2011, 1, 1),
11681168
'2Q2005': datetime(2005, 4, 1),

pandas/tests/scalar/test_timestamp.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616

1717
import pandas.util.testing as tm
1818
from pandas.tseries import offsets, frequencies
19-
from pandas._libs.tslibs.timezones import get_timezone
20-
from pandas._libs.tslibs import conversion, period
19+
from pandas._libs import period
20+
from pandas._libs.tslibs.timezones import get_timezone, dateutil_gettz as gettz
21+
from pandas._libs.tslibs import conversion
2122

2223
from pandas.compat import long, PY3
2324
from pandas.util.testing import assert_series_equal
@@ -359,9 +360,7 @@ def test_conversion(self):
359360
'2014-01-01 00:00:00.000000001'])
360361
def test_repr(self, date, freq):
361362
# dateutil zone change (only matters for repr)
362-
if (dateutil.__version__ >= LooseVersion('2.3') and
363-
(dateutil.__version__ <= LooseVersion('2.4.0') or
364-
dateutil.__version__ >= LooseVersion('2.6.0'))):
363+
if dateutil.__version__ >= LooseVersion('2.6.0'):
365364
timezones = ['UTC', 'Asia/Tokyo', 'US/Eastern',
366365
'dateutil/US/Pacific']
367366
else:
@@ -1381,7 +1380,6 @@ def test_timestamp_to_datetime_explicit_pytz(self):
13811380
def test_timestamp_to_datetime_explicit_dateutil(self):
13821381
tm._skip_if_windows_python_3()
13831382

1384-
from pandas._libs.tslibs.timezones import dateutil_gettz as gettz
13851383
stamp = Timestamp('20090415', tz=gettz('US/Eastern'), freq='D')
13861384
dtval = stamp.to_pydatetime()
13871385
assert stamp == dtval

0 commit comments

Comments
 (0)