Skip to content

Commit 9cf5dfc

Browse files
committed
MAINT: Remove Python 2.7
Remove from support and testing
1 parent 57766a5 commit 9cf5dfc

File tree

5 files changed

+14
-30
lines changed

5 files changed

+14
-30
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ env:
1010
matrix:
1111
fast_finish: true
1212
include:
13-
- python: 2.7
14-
env: PANDAS=0.24 NUMPY=1.16
1513
- python: 3.5
1614
env: PANDAS=0.21 NUMPY=1.13
1715
- python: 3.5
@@ -24,6 +22,8 @@ matrix:
2422
env: PANDAS=0.25 NUMPY=1.17
2523
- python: 3.7
2624
env: TEST_TYPE="quandl" PANDAS=0.25 NUMPY=1.17
25+
- python: 3.8
26+
env: PANDAS=0.25 NUMPY=1.18
2727
# In allow failures
2828
- python: 3.7
2929
env: TEST_TYPE="alpha_vantage" PANDAS=0.25 NUMPY=1.17

README.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ Up to date remote data access for pandas, works for multiple versions of pandas.
2424

2525
.. warning::
2626

27-
v0.8.0 is the last version which officially supports Python 2.7. Future versions of ``pandas_datareader`` will end support for Python 2.x.
27+
v0.8.0 is the last version which officially supports Python 2.7. Future versions of
28+
``pandas_datareader`` will end support for Python 2.x.
2829

2930
.. warning::
3031

pandas_datareader/compat/__init__.py

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
import pandas.io.common as com
77
from pandas.util.testing import assert_frame_equal
88

9-
PY3 = sys.version_info >= (3, 0)
10-
119
PANDAS_VERSION = LooseVersion(pd.__version__)
1210

1311
PANDAS_0210 = PANDAS_VERSION >= LooseVersion("0.21.0")
@@ -45,34 +43,20 @@ def get_filepath_or_buffer(filepath_or_buffer, encoding=None, compression=None):
4543
)
4644

4745

48-
if PY3:
49-
from urllib.error import HTTPError
50-
from functools import reduce
51-
52-
string_types = (str,)
53-
binary_type = bytes
54-
from io import StringIO
55-
56-
def str_to_bytes(s, encoding=None):
57-
return s.encode(encoding or "ascii")
58-
59-
def bytes_to_str(b, encoding=None):
60-
return b.decode(encoding or "utf-8")
46+
from urllib.error import HTTPError
47+
from functools import reduce
6148

49+
string_types = (str,)
50+
binary_type = bytes
51+
from io import StringIO
6252

63-
else:
64-
from urllib2 import HTTPError
65-
from cStringIO import StringIO
6653

67-
reduce = reduce
68-
binary_type = str
69-
string_types = (basestring,) # noqa: F821
54+
def str_to_bytes(s, encoding=None):
55+
return s.encode(encoding or "ascii")
7056

71-
def bytes_to_str(b, encoding=None):
72-
return b
7357

74-
def str_to_bytes(s, encoding=None):
75-
return s
58+
def bytes_to_str(b, encoding=None):
59+
return b.decode(encoding or "utf-8")
7660

7761

7862
def lmap(*args, **kwargs):

pandas_datareader/tests/test_tiingo.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import pandas as pd
44
import pytest
55

6-
from pandas_datareader.compat import PY3
76
from pandas_datareader.tiingo import (
87
TiingoDailyReader,
98
TiingoIEXHistoricalReader,
@@ -64,7 +63,6 @@ def test_tiingo_metadata(symbols):
6463
assert df.shape[1] == len(symbols)
6564

6665

67-
@pytest.mark.skipif(not PY3, reason="test.support missing on Python 2")
6866
def test_tiingo_no_api_key(symbols):
6967
from test.support import EnvironmentVarGuard
7068

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,5 @@ def readme():
5050
test_suite="tests",
5151
tests_require=tests_require,
5252
zip_safe=False,
53+
python_requires=">=3.5",
5354
)

0 commit comments

Comments
 (0)