|
5 | 5 | (https://github.com/zeromq/pyzmq) and hence are subject to the terms of the
|
6 | 6 | Lesser GPU General Public License.
|
7 | 7 | """
|
| 8 | + |
| 9 | +from distutils.core import setup, Command |
8 | 10 | # 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 |
14 | 16 |
|
15 | 17 | from datetime import datetime
|
16 | 18 | from glob import glob
|
17 | 19 | import os
|
18 | 20 | import sys
|
19 | 21 | import shutil
|
| 22 | +import warnings |
20 | 23 |
|
21 | 24 | import numpy as np
|
22 | 25 |
|
23 | 26 | # from numpy.distutils.core import setup
|
24 | 27 |
|
25 |
| -from distutils.core import setup, Command |
26 | 28 | from distutils.extension import Extension
|
27 | 29 | from distutils.command.build import build
|
28 | 30 | from distutils.command.build_ext import build_ext
|
|
128 | 130 | import subprocess
|
129 | 131 | pipe = subprocess.Popen(["git", "rev-parse", "--short", "HEAD"],
|
130 | 132 | stdout=subprocess.PIPE).stdout
|
131 |
| - rev = pipe.read().strip() |
| 133 | + rev = pipe.read().strip().decode('ascii') |
132 | 134 | FULLVERSION += "-%s" % rev
|
133 | 135 | except:
|
134 |
| - print "WARNING: Couldn't get git revision" |
| 136 | + warnings.warn("WARNING: Couldn't get git revision") |
135 | 137 |
|
136 | 138 | def write_version_py(filename='pandas/version.py'):
|
137 | 139 | cnt = """\
|
@@ -215,10 +217,10 @@ def check_cython_extensions(self, extensions):
|
215 | 217 | for ext in extensions:
|
216 | 218 | for src in ext.sources:
|
217 | 219 | if not os.path.exists(src):
|
218 |
| - print """Cython-generated file '%s' not found. |
| 220 | + raise Exception("""Cython-generated file '%s' not found. |
219 | 221 | Cython is required to compile pandas from a development branch.
|
220 | 222 | Please install Cython or download a release package of pandas.
|
221 |
| - """ % src |
| 223 | + """ % src) |
222 | 224 |
|
223 | 225 | def build_extensions(self):
|
224 | 226 | self.check_cython_extensions(self.extensions)
|
@@ -279,7 +281,7 @@ def srcpath(name=None, suffix='.pyx', subdir='src'):
|
279 | 281 | extensions = [tseries_ext,
|
280 | 282 | sparse_ext]
|
281 | 283 |
|
282 |
| -setuptools_args = {} |
| 284 | +setuptools_args = {'use_2to3': True} |
283 | 285 |
|
284 | 286 | # if _have_setuptools:
|
285 | 287 | # setuptools_args["test_suite"] = "nose.collector"
|
|
0 commit comments