Skip to content

Commit f58ae29

Browse files
committed
BLD: require python-dateutil>=2.5.0
1 parent d163de7 commit f58ae29

File tree

10 files changed

+27
-30
lines changed

10 files changed

+27
-30
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
@@ -85,8 +85,20 @@ Backwards incompatible API changes
8585
- :func:`Series.fillna` now raises a ``TypeError`` instead of a ``ValueError`` when passed a list, tuple or DataFrame as a ``value`` (:issue:`18293`)
8686
- :func:`pandas.DataFrame.merge` no longer casts a ``float`` column to ``object`` when merging on ``int`` and ``float`` columns (:issue:`16572`)
8787
- 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`)
88-
-
8988

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

91103

92104

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

+2-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import pandas.util.testing as tm
1818
from pandas.tseries import offsets, frequencies
1919
from pandas._libs import period
20-
from pandas._libs.tslibs.timezones import get_timezone
20+
from pandas._libs.tslibs.timezones import get_timezone, dateutil_gettz as gettz
2121
from pandas._libs.tslibs import conversion
2222

2323
from pandas.compat import long, PY3
@@ -341,9 +341,7 @@ def test_repr(self):
341341
'2014-01-01 00:00:00.000000001']
342342

343343
# dateutil zone change (only matters for repr)
344-
if (dateutil.__version__ >= LooseVersion('2.3') and
345-
(dateutil.__version__ <= LooseVersion('2.4.0') or
346-
dateutil.__version__ >= LooseVersion('2.6.0'))):
344+
if dateutil.__version__ >= LooseVersion('2.6.0'):
347345
timezones = ['UTC', 'Asia/Tokyo', 'US/Eastern',
348346
'dateutil/US/Pacific']
349347
else:
@@ -1345,7 +1343,6 @@ def test_timestamp_to_datetime_explicit_pytz(self):
13451343
def test_timestamp_to_datetime_explicit_dateutil(self):
13461344
tm._skip_if_windows_python_3()
13471345

1348-
from pandas._libs.tslibs.timezones import dateutil_gettz as gettz
13491346
stamp = Timestamp('20090415', tz=gettz('US/Eastern'), freq='D')
13501347
dtval = stamp.to_pydatetime()
13511348
assert stamp == dtval

0 commit comments

Comments
 (0)