Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions python/pyarrow/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import itertools

import numpy as np
import pandas as pd

import sys
import six
Expand All @@ -31,6 +30,17 @@
PY26 = sys.version_info[:2] == (2, 6)
PY2 = sys.version_info[0] == 2

try:
import pandas as pd
if LooseVersion(pd.__version__) < '0.19.0':
pdapi = pd.core.common
from pandas.core.dtypes import DatetimeTZDtype
else:
from pandas.types.dtypes import DatetimeTZDtype
pdapi = pd.api.types
HAVE_PANDAS = True
except:
HAVE_PANDAS = False

if PY26:
import unittest2 as unittest
Expand Down Expand Up @@ -117,13 +127,6 @@ def encode_file_path(path):
return encoded_path


if LooseVersion(pd.__version__) < '0.19.0':
pdapi = pd.core.common
from pandas.core.dtypes import DatetimeTZDtype
else:
from pandas.types.dtypes import DatetimeTZDtype
pdapi = pd.api.types

integer_types = six.integer_types + (np.integer,)

__all__ = []
21 changes: 13 additions & 8 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
# specific language governing permissions and limitations
# under the License.

import glob
import os.path as osp
import re
import shutil
Expand Down Expand Up @@ -83,16 +82,20 @@ def run(self):
('build-type=', None, 'build type (debug or release)'),
('with-parquet', None, 'build the Parquet extension'),
('with-jemalloc', None, 'build the jemalloc extension'),
('bundle-arrow-cpp', None, 'bundle the Arrow C++ libraries')] +
('bundle-arrow-cpp', None,
'bundle the Arrow C++ libraries')] +
_build_ext.user_options)

def initialize_options(self):
_build_ext.initialize_options(self)
self.extra_cmake_args = os.environ.get('PYARROW_CMAKE_OPTIONS', '')
self.build_type = os.environ.get('PYARROW_BUILD_TYPE', 'debug').lower()
self.with_parquet = strtobool(os.environ.get('PYARROW_WITH_PARQUET', '0'))
self.with_jemalloc = strtobool(os.environ.get('PYARROW_WITH_JEMALLOC', '0'))
self.bundle_arrow_cpp = strtobool(os.environ.get('PYARROW_BUNDLE_ARROW_CPP', '0'))
self.with_parquet = strtobool(
os.environ.get('PYARROW_WITH_PARQUET', '0'))
self.with_jemalloc = strtobool(
os.environ.get('PYARROW_WITH_JEMALLOC', '0'))
self.bundle_arrow_cpp = strtobool(
os.environ.get('PYARROW_BUNDLE_ARROW_CPP', '0'))

CYTHON_MODULE_NAMES = [
'array',
Expand Down Expand Up @@ -300,8 +303,10 @@ def get_outputs(self):
if not os.path.exists('../.git') and os.path.exists('../java/pom.xml'):
import xml.etree.ElementTree as ET
tree = ET.parse('../java/pom.xml')
version_tag = list(tree.getroot().findall('{http://maven.apache.org/POM/4.0.0}version'))[0]
os.environ["SETUPTOOLS_SCM_PRETEND_VERSION"] = version_tag.text.replace("-SNAPSHOT", "a0")
version_tag = list(tree.getroot().findall(
'{http://maven.apache.org/POM/4.0.0}version'))[0]
os.environ["SETUPTOOLS_SCM_PRETEND_VERSION"] = version_tag.text.replace(
"-SNAPSHOT", "a0")

long_description = """Apache Arrow is a columnar in-memory analytics layer
designed to accelerate big data. It houses a set of canonical in-memory
Expand All @@ -321,7 +326,7 @@ def get_outputs(self):
'clean': clean,
'build_ext': build_ext
},
use_scm_version = {"root": "..", "relative_to": __file__},
use_scm_version={"root": "..", "relative_to": __file__},
setup_requires=['setuptools_scm', 'cython >= 0.23'],
install_requires=['numpy >= 1.9', 'six >= 1.0.0'],
test_requires=['pytest'],
Expand Down