Skip to content

Commit b4baa64

Browse files
takluyverwesm
authored andcommitted
Pandas installs on Python 3
Initial rough & ready pass so that pandas can be installed on Python 3, using distribute. Importing pandas still fails.
1 parent cbf7616 commit b4baa64

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

pandas/src/tseries.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ cdef double_t *get_double_ptr(ndarray arr):
4949
cdef extern from "math.h":
5050
double sqrt(double x)
5151

52-
cdef extern from "cobject.h":
53-
pass # for datetime API
52+
#cdef extern from "cobject.h":
53+
# pass # for datetime API
5454

5555
cdef extern from "datetime.h":
5656

setup.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,26 @@
55
(https://github.com/zeromq/pyzmq) and hence are subject to the terms of the
66
Lesser GPU General Public License.
77
"""
8+
9+
from distutils.core import setup, Command
810
# use setuptools if available
9-
# try:
10-
# from setuptools import setup
11-
# _have_setuptools = True
12-
# except ImportError:
13-
# _have_setuptools = False
11+
try:
12+
from setuptools import setup
13+
_have_setuptools = True
14+
except ImportError:
15+
_have_setuptools = False
1416

1517
from datetime import datetime
1618
from glob import glob
1719
import os
1820
import sys
1921
import shutil
22+
import warnings
2023

2124
import numpy as np
2225

2326
# from numpy.distutils.core import setup
2427

25-
from distutils.core import setup, Command
2628
from distutils.extension import Extension
2729
from distutils.command.build import build
2830
from distutils.command.build_ext import build_ext
@@ -128,10 +130,10 @@
128130
import subprocess
129131
pipe = subprocess.Popen(["git", "rev-parse", "--short", "HEAD"],
130132
stdout=subprocess.PIPE).stdout
131-
rev = pipe.read().strip()
133+
rev = pipe.read().strip().decode('ascii')
132134
FULLVERSION += "-%s" % rev
133135
except:
134-
print "WARNING: Couldn't get git revision"
136+
warnings.warn("WARNING: Couldn't get git revision")
135137

136138
def write_version_py(filename='pandas/version.py'):
137139
cnt = """\
@@ -215,10 +217,10 @@ def check_cython_extensions(self, extensions):
215217
for ext in extensions:
216218
for src in ext.sources:
217219
if not os.path.exists(src):
218-
print """Cython-generated file '%s' not found.
220+
raise Exception("""Cython-generated file '%s' not found.
219221
Cython is required to compile pandas from a development branch.
220222
Please install Cython or download a release package of pandas.
221-
""" % src
223+
""" % src)
222224

223225
def build_extensions(self):
224226
self.check_cython_extensions(self.extensions)
@@ -279,7 +281,7 @@ def srcpath(name=None, suffix='.pyx', subdir='src'):
279281
extensions = [tseries_ext,
280282
sparse_ext]
281283

282-
setuptools_args = {}
284+
setuptools_args = {'use_2to3': True}
283285

284286
# if _have_setuptools:
285287
# setuptools_args["test_suite"] = "nose.collector"

0 commit comments

Comments
 (0)