fix windows build

This commit is contained in:
Philipp Moritz committed 2017-07-19 12:00:47 -07:00
1 parent 3e4a84d6dc
commit b9e2dee1ed
7 files changed
+34 -13

No files matched your search

+1
View File
@@ -17,6 +17,7 @@ set -e
source $TRAVIS_BUILD_DIR/ci/travis_env_common.sh
export ARROW_HOME=$ARROW_CPP_INSTALL
export PYARROW_WITH_PLASMA=1
pushd $ARROW_PYTHON_DIR
+1
View File
@@ -17,6 +17,7 @@ set -e
source $TRAVIS_BUILD_DIR/ci/travis_env_common.sh
export ARROW_HOME=$ARROW_CPP_INSTALL
export PYARROW_WITH_PLASMA=1
pushd $ARROW_PYTHON_DIR
export PARQUET_HOME=$TRAVIS_BUILD_DIR/parquet-env
+13 -4
View File
@@ -222,7 +222,9 @@ include_directories(SYSTEM ${ARROW_INCLUDE_DIR})
## Plasma
find_package(Plasma)
include_directories(SYSTEM ${PLASMA_INCLUDE_DIR})
if (PLASMA_FOUND)
include_directories(SYSTEM ${PLASMA_INCLUDE_DIR})
endif()
function(bundle_arrow_lib library_path)
get_filename_component(LIBRARY_DIR ${${library_path}} DIRECTORY)
@@ -256,7 +258,9 @@ if (PYARROW_BUNDLE_ARROW_CPP)
file(COPY ${ARROW_INCLUDE_DIR}/arrow DESTINATION ${BUILD_OUTPUT_ROOT_DIRECTORY}/include)
bundle_arrow_lib(ARROW_SHARED_LIB)
bundle_arrow_lib(ARROW_PYTHON_SHARED_LIB)
bundle_arrow_lib(PLASMA_SHARED_LIB)
if (PLASMA_FOUND)
bundle_arrow_lib(PLASMA_SHARED_LIB)
endif()
endif()
if (MSVC)
@@ -281,9 +285,12 @@ endif()
set(CYTHON_EXTENSIONS
lib
plasma
)
if (PLASMA_FOUND)
set(CYTHON_EXTENSIONS ${CYTHON_EXTENSIONS} plasma)
endif()
set(LINK_LIBS
arrow_shared
arrow_python_shared
@@ -387,4 +394,6 @@ foreach(module ${CYTHON_EXTENSIONS})
target_link_libraries(${module_name} ${LINK_LIBS})
endforeach(module)
file(COPY ${PLASMA_EXECUTABLE} DESTINATION ${BUILD_OUTPUT_ROOT_DIRECTORY})
if (PLASMA_FOUND)
file(COPY ${PLASMA_EXECUTABLE} DESTINATION ${BUILD_OUTPUT_ROOT_DIRECTORY})
endif()
+1
View File
@@ -35,6 +35,7 @@ cd /arrow/python
# PyArrow build configuration
export PYARROW_BUILD_TYPE='release'
export PYARROW_WITH_PARQUET=1
export PYARROW_WITH_PLASMA=1
export PYARROW_BUNDLE_ARROW_CPP=1
# Need as otherwise arrow_io is sometimes not linked
export LDFLAGS="-Wl,--no-as-needed"
+1 -1
View File
@@ -23,7 +23,7 @@ groups = ['hdfs', 'parquet', 'plasma', 'large_memory']
defaults = {
'hdfs': False,
'parquet': False,
'plasma': False
'plasma': False,
'large_memory': False
}
+5 -1
View File
@@ -31,7 +31,6 @@ import time
import unittest
import pyarrow as pa
import pyarrow.plasma as plasma
import pandas as pd
DEFAULT_PLASMA_STORE_MEMORY = 10 ** 9
@@ -41,6 +40,7 @@ def random_name():
def random_object_id():
import pyarrow.plasma as plasma
return plasma.ObjectID(np.random.bytes(20))
@@ -83,6 +83,7 @@ def create_object(client, data_size, metadata_size, seal=True):
def assert_get_object_equal(unit_test, client1, client2, object_id,
memory_buffer=None, metadata=None):
import pyarrow.plasma as plasma
client1_buff = client1.get([object_id])[0]
client2_buff = client2.get([object_id])[0]
client1_metadata = client1.get_metadata([object_id])[0]
@@ -148,6 +149,7 @@ def start_plasma_store(plasma_store_memory=DEFAULT_PLASMA_STORE_MEMORY,
class TestPlasmaClient(object):
def setup_method(self, test_method):
import pyarrow.plasma as plasma
# Start Plasma store.
plasma_store_name, self.p = start_plasma_store(
use_valgrind=os.getenv("PLASMA_VALGRIND") == "1")
@@ -270,6 +272,7 @@ class TestPlasmaClient(object):
assert results[i] is None
def test_store_arrow_objects(self):
import pyarrow.plasma as plasma
data = np.random.randn(10, 4)
# Write an arrow object.
object_id = random_object_id()
@@ -287,6 +290,7 @@ class TestPlasmaClient(object):
np.testing.assert_equal(data, array)
def test_store_pandas_dataframe(self):
import pyarrow.plasma as plasma
d = {'one': pd.Series([1., 2., 3.], index=['a', 'b', 'c']),
'two': pd.Series([1., 2., 3., 4.], index=['a', 'b', 'c', 'd'])}
df = pd.DataFrame(d)
+12 -7
View File
@@ -99,13 +99,16 @@ class build_ext(_build_ext):
self.with_parquet = strtobool(
os.environ.get('PYARROW_WITH_PARQUET', '0'))
self.with_plasma = strtobool(
os.environ.get('PYARROW_WITH_PLASMA', '0'))
if self.with_plasma:
self.CYTHON_MODULE_NAMES.append("plasma")
self.bundle_arrow_cpp = strtobool(
os.environ.get('PYARROW_BUNDLE_ARROW_CPP', '0'))
CYTHON_MODULE_NAMES = [
'lib',
'_parquet',
'plasma']
'_parquet']
def _run_cmake(self):
# The directory containing this setup.py
@@ -243,7 +246,8 @@ class build_ext(_build_ext):
shutil.move(pjoin(build_prefix, 'include'), pjoin(build_lib, 'pyarrow'))
move_lib("arrow")
move_lib("arrow_python")
move_lib("plasma")
if self.with_plasma:
move_lib("plasma")
if self.with_parquet:
move_lib("parquet")
@@ -273,10 +277,11 @@ class build_ext(_build_ext):
pjoin(os.path.dirname(ext_path), name + '_api.h'))
# Move the plasma store
build_py = self.get_finalized_command('build_py')
source = os.path.join(self.build_type, "plasma_store")
target = os.path.join(build_lib, build_py.get_package_dir('pyarrow'), "plasma_store")
shutil.move(source, target)
if self.with_plasma:
build_py = self.get_finalized_command('build_py')
source = os.path.join(self.build_type, "plasma_store")
target = os.path.join(build_lib, build_py.get_package_dir('pyarrow'), "plasma_store")
shutil.move(source, target)
os.chdir(saved_cwd)