Repository: pandas-dev/pandas

Issue:
INT: Add 0.13 release pickles



Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -555,6 +555,7 @@ def pxd(name):
                                   'tests/data/legacy_pickle/0.10.1/*.pickle',
                                   'tests/data/legacy_pickle/0.11.0/*.pickle',
                                   'tests/data/legacy_pickle/0.12.0/*.pickle',
+                                  'tests/data/legacy_pickle/0.13.0/*.pickle',
                                   'tests/data/*.csv',
                                   'tests/data/*.dta',
                                   'tests/data/*.txt',


Test patch:
diff --git a/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_AMD64_windows_2.7.3.pickle b/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_AMD64_windows_2.7.3.pickle
new file mode 100644
Binary files /dev/null and b/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_AMD64_windows_2.7.3.pickle differ
diff --git a/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_i686_linux_2.6.5.pickle b/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_i686_linux_2.6.5.pickle
new file mode 100644
Binary files /dev/null and b/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_i686_linux_2.6.5.pickle differ
diff --git a/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_i686_linux_2.7.3.pickle b/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_i686_linux_2.7.3.pickle
new file mode 100644
Binary files /dev/null and b/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_i686_linux_2.7.3.pickle differ
diff --git a/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_i686_linux_3.2.3.pickle b/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_i686_linux_3.2.3.pickle
new file mode 100644
Binary files /dev/null and b/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_i686_linux_3.2.3.pickle differ
diff --git a/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_x86_64_darwin_2.7.5.pickle b/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_x86_64_darwin_2.7.5.pickle
new file mode 100644
Binary files /dev/null and b/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_x86_64_darwin_2.7.5.pickle differ
diff --git a/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_x86_64_linux_2.7.3.pickle b/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_x86_64_linux_2.7.3.pickle
new file mode 100644
Binary files /dev/null and b/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_x86_64_linux_2.7.3.pickle differ
diff --git a/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_x86_64_linux_3.3.0.pickle b/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_x86_64_linux_3.3.0.pickle
new file mode 100644
Binary files /dev/null and b/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_x86_64_linux_3.3.0.pickle differ
diff --git a/pandas/io/tests/generate_legacy_pickles.py b/pandas/io/tests/generate_legacy_pickles.py
--- a/pandas/io/tests/generate_legacy_pickles.py
+++ b/pandas/io/tests/generate_legacy_pickles.py
@@ -1,12 +1,6 @@
 """ self-contained to write legacy pickle files """
 from __future__ import print_function
 
-# make sure we are < 0.13 compat (in py3)
-try:
-    from pandas.compat import zip, cPickle as pickle
-except:
-    import pickle
-
 def _create_sp_series():
 
     import numpy as np
@@ -114,21 +108,35 @@ def write_legacy_pickles():
     import sys
     sys.path.insert(0,'.')
 
-    import os
+    import os, os.path
     import numpy as np
     import pandas
     import pandas.util.testing as tm
     import platform as pl
 
-    print("This script generates a pickle file for the current arch, system, and python version")
+    # make sure we are < 0.13 compat (in py3)
+    try:
+        from pandas.compat import zip, cPickle as pickle
+    except:
+        import pickle
+
+    sys_version = version = pandas.__version__
+    if len(sys.argv) < 2:
+        exit("{0} <version> <output_dir>".format(sys.argv[0]))
 
-    version = pandas.__version__
+    version = str(sys.argv[1])
+    output_dir = str(sys.argv[2])
+
+    print("This script generates a pickle file for the current arch, system, and python version")
+    print("  system version: {0}".format(sys_version))
+    print("  output version: {0}".format(version))
+    print("  output dir    : {0}".format(output_dir))
 
     # construct a reasonable platform name
     f = '_'.join([ str(version), str(pl.machine()), str(pl.system().lower()), str(pl.python_version()) ])
     pth = '{0}.pickle'.format(f)
 
-    fh = open(pth,'wb')
+    fh = open(os.path.join(output_dir,pth),'wb')
     pickle.dump(create_data(),fh,pickle.HIGHEST_PROTOCOL)
     fh.close()
 
diff --git a/pandas/io/tests/test_pickle.py b/pandas/io/tests/test_pickle.py
--- a/pandas/io/tests/test_pickle.py
+++ b/pandas/io/tests/test_pickle.py
@@ -80,6 +80,9 @@ def test_read_pickles_0_11_0(self):
     def test_read_pickles_0_12_0(self):
         self.read_pickles('0.12.0')
 
+    def test_read_pickles_0_13_0(self):
+        self.read_pickles('0.13.0')
+
     def test_round_trip_current(self):
 
         for typ, dv in self.data.items():