Skip to content

Commit 9ca31b7

Browse files
committed
BLD: require python-dateutil>=2.5.0
1 parent 6b8474a commit 9ca31b7

File tree

10 files changed

+26
-29
lines changed

10 files changed

+26
-29
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

+12
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,18 @@ Other Enhancements
3131
Backwards incompatible API changes
3232
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3333

34+
Dependencies have increased minimum versions
35+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
36+
37+
We have updated our minimum supported versions of dependencies ().
38+
If installed, we now require:
39+
40+
+-----------------+-----------------+----------+
41+
| Package | Minimum Version | Required |
42+
+=================+=================+==========+
43+
| python-dateutil | 2.5.0 | X |
44+
+-----------------+-----------------+----------+
45+
3446
-
3547
-
3648
-

pandas/compat/__init__.py

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

380380

381-
# http://stackoverflow.com/questions/4126348
382-
# Thanks to @martineau at SO
383-
381+
# dateutil minimum version
384382
import dateutil
385383

386-
if PY2 and LooseVersion(dateutil.__version__) == '2.0':
387-
# dateutil brokenness
388-
raise Exception('dateutil 2.0 incompatible with Python 2.x, you must '
389-
'install version 1.5 or 2.1+!')
390-
384+
if LooseVersion(dateutil.__version__) < '2.5':
385+
raise ImportError('dateutil 2.5.0 is the minimum required version')
391386
from dateutil import parser as _date_parser
392-
if LooseVersion(dateutil.__version__) < '2.0':
393-
394-
@functools.wraps(_date_parser.parse)
395-
def parse_date(timestr, *args, **kwargs):
396-
timestr = bytes(timestr)
397-
return _date_parser.parse(timestr, *args, **kwargs)
398-
else:
399-
parse_date = _date_parser.parse
387+
parse_date = _date_parser.parse
400388

401389

402390
# 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 lrange, long, PY3
@@ -319,9 +319,7 @@ def test_repr(self):
319319
'2014-01-01 00:00:00.000000001']
320320

321321
# dateutil zone change (only matters for repr)
322-
if (dateutil.__version__ >= LooseVersion('2.3') and
323-
(dateutil.__version__ <= LooseVersion('2.4.0') or
324-
dateutil.__version__ >= LooseVersion('2.6.0'))):
322+
if dateutil.__version__ >= LooseVersion('2.6.0'):
325323
timezones = ['UTC', 'Asia/Tokyo', 'US/Eastern',
326324
'dateutil/US/Pacific']
327325
else:
@@ -1324,7 +1322,6 @@ def test_timestamp_to_datetime_explicit_pytz(self):
13241322
def test_timestamp_to_datetime_explicit_dateutil(self):
13251323
tm._skip_if_windows_python_3()
13261324

1327-
from pandas._libs.tslibs.timezones import dateutil_gettz as gettz
13281325
stamp = Timestamp('20090415', tz=gettz('US/Eastern'), freq='D')
13291326
dtval = stamp.to_pydatetime()
13301327
assert stamp == dtval

0 commit comments

Comments
 (0)