Skip to content

Commit 680922c

Browse files
committed
Merge pull request #2 from hayd/travis
Travis working
2 parents ea034a7 + 4f3bbb5 commit 680922c

22 files changed

+51
-20
lines changed

.travis.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ env:
55
- PYTHON=2.7 PANDAS=0.15.1
66
- PYTHON=3.3 PANDAS=0.14.1
77
- PYTHON=3.4 PANDAS=0.15.1
8+
- PYTHON=2.7 PANDAS=0.12.0
9+
- PYTHON=2.7 PANDAS=0.11.0
10+
- PYTHON=2.7 PANDAS=0.10.1
11+
12+
matrix:
13+
allow_failures:
14+
- env: PYTHON=2.7 PANDAS=0.12.0
15+
- env: PYTHON=2.7 PANDAS=0.11.0
16+
- env: PYTHON=2.7 PANDAS=0.10.1
817

918
install:
1019
- sudo apt-get update
@@ -26,13 +35,13 @@ install:
2635
- conda info -a
2736

2837
# Replace dep1 dep2 ... with your dependencies
29-
- conda create -q -n test-environment python=$PYTHON pandas=$PANDAS nose coverage
38+
- conda create -q -n test-environment python=$PYTHON pandas=$PANDAS nose coverage setuptools
3039
- source activate test-environment
3140
- conda list
3241
- python setup.py install
3342

3443
script:
35-
- nosetests --with-coverage --cover-package=pandas_data_readers
44+
- nosetests --with-coverage --cover-package=pandas_datareader
3645

3746
after_success:
3847
- coveralls

MANIFEST.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
include README.md
22
include LICENSE.md
3-
include pandas_data_readers/*.py
3+
include pandas_datareader/*.py
44

5-
include pandas_data_readers/tests/*.py
6-
include pandas_data_readers/tests/data/*
5+
include pandas_datareader/tests/*.py
6+
include pandas_datareader/tests/data/*
File renamed without changes.

pandas_data_readers/data.py renamed to pandas_datareader/data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def _retry_read_url(url, retry_count, pause, name):
166166
pass
167167
else:
168168
rs = read_csv(StringIO(bytes_to_str(lines)), index_col=0,
169-
parse_dates=True)[::-1]
169+
parse_dates=True, na_values='-')[::-1]
170170
# Yahoo! Finance sometimes does this awesome thing where they
171171
# return 2 rows for the most recent business day
172172
if len(rs) > 2 and rs.index[-1] == rs.index[-2]: # pragma: no cover

pandas_data_readers/tests/test_data.py renamed to pandas_datareader/tests/test_data.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,23 @@
99
import numpy as np
1010
import pandas as pd
1111
from pandas import DataFrame, Timestamp
12-
from pandas.util.testing import (assert_series_equal, assert_produces_warning,
13-
network, assert_frame_equal)
12+
from pandas.util.testing import (assert_frame_equal, assert_series_equal,
13+
network)
14+
try:
15+
from pandas.util.testing import assert_produces_warning
16+
except ImportError:
17+
assert_produces_warning = None
18+
1419
import pandas.util.testing as tm
1520
from numpy.testing import assert_array_equal
1621

17-
if compat.PY3:
22+
try:
1823
from urllib.error import HTTPError
19-
else:
24+
except ImportError:
2025
from urllib2 import HTTPError
2126

22-
import pandas_data_readers.data as web
23-
from pandas_data_readers.data import (
27+
import pandas_datareader.data as web
28+
from pandas_datareader.data import (
2429
DataReader, SymbolWarning, RemoteDataError, _yahoo_codes)
2530

2631
def _skip_if_no_lxml():
@@ -119,8 +124,8 @@ def test_get_multi2(self):
119124
assert_n_failed_equals_n_null_columns(w, result)
120125

121126
def test_dtypes(self):
122-
#GH3995
123-
data = web.get_data_google('MSFT', 'JAN-01-12', 'JAN-31-12')
127+
#GH399, #GH8980
128+
data = web.get_data_google('F', start='JAN-01-10', end='JAN-27-13')
124129
assert np.issubdtype(data.Open.dtype, np.number)
125130
assert np.issubdtype(data.Close.dtype, np.number)
126131
assert np.issubdtype(data.Low.dtype, np.number)
@@ -401,6 +406,9 @@ def tearDownClass(cls):
401406

402407
@network
403408
def test_options_source_warning(self):
409+
if not assert_produces_warning:
410+
raise SkipTest("old version of pandas without "
411+
"compat.assert_produces_warning")
404412
with assert_produces_warning():
405413
aapl = web.Options('aapl')
406414

pandas_data_readers/tests/test_wb.py renamed to pandas_datareader/tests/test_wb.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
import nose
22

33
import pandas
4-
from pandas.compat import u
54
from pandas.util.testing import network
65
from pandas.util.testing import assert_frame_equal
76
from numpy.testing.decorators import slow
87
import pandas.util.testing as tm
98

10-
from pandas_data_readers.wb import search, download, get_countries
9+
from pandas_datareader.wb import search, download, get_countries
10+
11+
try:
12+
from pandas.compat import u
13+
except ImportError:
14+
try:
15+
unicode # python 2
16+
def u(s):
17+
return unicode(s, "unicode_escape")
18+
except NameError:
19+
def u(s):
20+
return s
1121

1222

1323
class TestWB(tm.TestCase):
@@ -41,10 +51,14 @@ def test_wdi_download(self):
4151

4252
expected = {'NY.GDP.PCAP.CD': {('Canada', '2003'): 28026.006013044702, ('Mexico', '2003'): 6601.0420648056606, ('Canada', '2004'): 31829.522562759001, ('Kosovo', '2003'): 1969.56271307405, ('Mexico', '2004'): 7042.0247834044303, ('United States', '2004'): 41928.886136479705, ('United States', '2003'): 39682.472247320402, ('Kosovo', '2004'): 2135.3328465238301}}
4353
expected = pandas.DataFrame(expected)
54+
# Round, to ignore revisions to data.
55+
expected = pandas.np.round(expected,decimals=-3)
4456
expected.sort(inplace=True)
4557
result = download(country=cntry_codes, indicator=inds,
4658
start=2003, end=2004, errors='ignore')
4759
result.sort(inplace=True)
60+
# Round, to ignore revisions to data.
61+
result = pandas.np.round(result,decimals=-3)
4862
expected.index = result.index
4963
assert_frame_equal(result, pandas.DataFrame(expected))
5064

File renamed without changes.

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
from setuptools import setup
77

88

9-
NAME = 'pandas_data_readers'
9+
NAME = 'pandas_datareader'
1010

1111

1212
def version():
1313
"""Return version string."""
1414
with open(os.path.join(os.path.abspath(os.path.dirname(__file__)),
15-
'pandas_data_readers',
15+
'pandas_datareader',
1616
'__init__.py')) as input_file:
1717
for line in input_file:
1818
if line.startswith('__version__'):
@@ -36,7 +36,7 @@ def readme():
3636
license='MIT License',
3737
author='Andy Hayden',
3838
author_email='[email protected]',
39-
url='https://github.com/hayd/pandas_data_readers',
39+
url='https://github.com/pydata/pandas_datareader',
4040
classifiers=[
4141
'Development Status :: 4 - Beta',
4242
'Operating System :: OS Independent',
@@ -51,7 +51,7 @@ def readme():
5151
],
5252
keywords='data',
5353
install_requires=INSTALL_REQUIRES,
54-
packages=['pandas_data_readers'],
54+
packages=['pandas_datareader'],
5555
test_suite='tests',
5656
zip_safe=False,
5757
)

0 commit comments

Comments
 (0)