Skip to content

Commit 7d6fb51

Browse files
committed
Merge pull request #10397 from jreback/py3.2
BLD: remove support for 3.2, #9118
2 parents af8eb59 + 528d8ad commit 7d6fb51

File tree

13 files changed

+11
-52
lines changed

13 files changed

+11
-52
lines changed

.travis.yml

-14
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,6 @@ matrix:
8686
- CLIPBOARD=xsel
8787
- BUILD_TYPE=conda
8888
- JOB_NAME: "34_slow"
89-
- python: 3.2
90-
env:
91-
- NOSE_ARGS="not slow and not network and not disabled"
92-
- FULL_DEPS=true
93-
- CLIPBOARD_GUI=qt4
94-
- BUILD_TYPE=pydata
95-
- JOB_NAME: "32_nslow"
9689
- python: 2.7
9790
env:
9891
- EXPERIMENTAL=true
@@ -103,13 +96,6 @@ matrix:
10396
- BUILD_TYPE=pydata
10497
- PANDAS_TESTING_MODE="deprecate"
10598
allow_failures:
106-
- python: 3.2
107-
env:
108-
- NOSE_ARGS="not slow and not network and not disabled"
109-
- FULL_DEPS=true
110-
- CLIPBOARD_GUI=qt4
111-
- BUILD_TYPE=pydata
112-
- JOB_NAME: "32_nslow"
11399
- python: 2.7
114100
env:
115101
- NOSE_ARGS="slow and not network and not disabled"

ci/requirements-3.2.txt

-4
This file was deleted.

doc/source/install.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Instructions for installing from source,
1818
Python version support
1919
----------------------
2020

21-
Officially Python 2.6, 2.7, 3.2, 3.3, and 3.4.
21+
Officially Python 2.6, 2.7, 3.3, and 3.4.
2222

2323
Installing pandas
2424
-----------------

doc/source/whatsnew/v0.17.0.txt

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ This is a major release from 0.16.2 and includes a small number of API changes,
77
enhancements, and performance improvements along with a large number of bug fixes. We recommend that all
88
users upgrade to this version.
99

10+
.. warning::
11+
12+
pandas >= 0.17.0 will no longer support compatibility with Python version 3.2 (:issue:`9118`)
13+
1014
Highlights include:
1115

1216

pandas/compat/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import types
3838

3939
PY3 = (sys.version_info[0] >= 3)
40-
PY3_2 = sys.version_info[:2] == (3, 2)
4140
PY2 = sys.version_info[0] == 2
4241

4342

pandas/core/common.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -2813,11 +2813,7 @@ def _get_handle(path, mode, encoding=None, compression=None):
28132813
else:
28142814
raise ValueError('Unrecognized compression type: %s' %
28152815
compression)
2816-
if compat.PY3_2:
2817-
# gzip and bz2 don't work with TextIOWrapper in 3.2
2818-
encoding = encoding or get_option('display.encoding')
2819-
f = StringIO(f.read().decode(encoding))
2820-
elif compat.PY3:
2816+
if compat.PY3:
28212817
from io import TextIOWrapper
28222818
f = TextIOWrapper(f, encoding=encoding)
28232819
return f

pandas/io/parsers.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -1327,10 +1327,7 @@ def _wrap_compressed(f, compression, encoding=None):
13271327
import gzip
13281328

13291329
f = gzip.GzipFile(fileobj=f)
1330-
if compat.PY3_2:
1331-
# 3.2's gzip doesn't support read1
1332-
f = StringIO(f.read().decode(encoding))
1333-
elif compat.PY3:
1330+
if compat.PY3:
13341331
from io import TextIOWrapper
13351332

13361333
f = TextIOWrapper(f)

pandas/tests/test_categorical.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,8 @@ def f():
395395
self.assertRaises(TypeError, lambda: cat_rev > a)
396396

397397
# The following work via '__array_priority__ = 1000'
398-
# works only on numpy >= 1.7.1 and not on PY3.2
399-
if LooseVersion(np.__version__) > "1.7.1" and not compat.PY3_2:
398+
# works only on numpy >= 1.7.1
399+
if LooseVersion(np.__version__) > "1.7.1":
400400
self.assertRaises(TypeError, lambda: a < cat)
401401
self.assertRaises(TypeError, lambda: a < cat_rev)
402402

pandas/tests/test_index.py

-8
Original file line numberDiff line numberDiff line change
@@ -2690,14 +2690,6 @@ def create_index(self):
26902690
def test_pickle_compat_construction(self):
26912691
pass
26922692

2693-
def test_numeric_compat(self):
2694-
super(TestDatetimeIndex, self).test_numeric_compat()
2695-
2696-
if not compat.PY3_2:
2697-
for f in [lambda : np.timedelta64(1, 'D').astype('m8[ns]') * pd.date_range('2000-01-01', periods=3),
2698-
lambda : pd.date_range('2000-01-01', periods=3) * np.timedelta64(1, 'D').astype('m8[ns]') ]:
2699-
self.assertRaises(TypeError, f)
2700-
27012693
def test_get_loc(self):
27022694
idx = pd.date_range('2000-01-01', periods=3)
27032695

pandas/tseries/tests/test_timedeltas.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from pandas import (Index, Series, DataFrame, Timestamp, Timedelta, TimedeltaIndex, isnull, notnull,
1212
bdate_range, date_range, timedelta_range, Int64Index)
1313
import pandas.core.common as com
14-
from pandas.compat import StringIO, lrange, range, zip, u, OrderedDict, long, PY3_2
14+
from pandas.compat import StringIO, lrange, range, zip, u, OrderedDict, long
1515
from pandas import compat, to_timedelta, tslib
1616
from pandas.tseries.timedeltas import _coerce_scalar_to_timedelta_type as ct
1717
from pandas.util.testing import (assert_series_equal,
@@ -1043,8 +1043,6 @@ def test_comparisons_coverage(self):
10431043
self.assert_numpy_array_equal(result, exp)
10441044

10451045
def test_comparisons_nat(self):
1046-
if PY3_2:
1047-
raise nose.SkipTest('nat comparisons on 3.2 broken')
10481046

10491047
tdidx1 = pd.TimedeltaIndex(['1 day', pd.NaT, '1 day 00:00:01', pd.NaT,
10501048
'1 day 00:00:01', '5 day 00:00:03'])

pandas/tseries/tests/test_timeseries.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
import pandas.index as _index
3030

31-
from pandas.compat import range, long, StringIO, lrange, lmap, zip, product, PY3_2
31+
from pandas.compat import range, long, StringIO, lrange, lmap, zip, product
3232
from numpy.random import rand
3333
from numpy.testing import assert_array_equal
3434
from pandas.util.testing import assert_frame_equal
@@ -2225,8 +2225,6 @@ def test_comparisons_coverage(self):
22252225
self.assert_numpy_array_equal(result, exp)
22262226

22272227
def test_comparisons_nat(self):
2228-
if PY3_2:
2229-
raise nose.SkipTest('nat comparisons on 3.2 broken')
22302228

22312229
fidx1 = pd.Index([1.0, np.nan, 3.0, np.nan, 5.0, 7.0])
22322230
fidx2 = pd.Index([2.0, 3.0, np.nan, np.nan, 6.0, 7.0])

pandas/tslib.pyx

-6
Original file line numberDiff line numberDiff line change
@@ -2799,9 +2799,6 @@ cdef inline _get_datetime64_nanos(object val):
27992799
npy_datetime ival
28002800

28012801
unit = get_datetime64_unit(val)
2802-
if unit == 3:
2803-
raise ValueError('NumPy 1.6.1 business freq not supported')
2804-
28052802
ival = get_datetime64_value(val)
28062803

28072804
if unit != PANDAS_FR_ns:
@@ -2872,9 +2869,6 @@ def cast_to_nanoseconds(ndarray arr):
28722869
return result
28732870

28742871
unit = get_datetime64_unit(arr.flat[0])
2875-
if unit == 3:
2876-
raise ValueError('NumPy 1.6.1 business freq not supported')
2877-
28782872
for i in range(n):
28792873
pandas_datetime_to_datetimestruct(ivalues[i], unit, &dts)
28802874
iresult[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts)

setup.py

-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ def build_extensions(self):
185185
'Programming Language :: Python :: 3',
186186
'Programming Language :: Python :: 2.6',
187187
'Programming Language :: Python :: 2.7',
188-
'Programming Language :: Python :: 3.2',
189188
'Programming Language :: Python :: 3.3',
190189
'Programming Language :: Python :: 3.4',
191190
'Programming Language :: Cython',

0 commit comments

Comments
 (0)