Skip to content

Instantly share code, notes, and snippets.

@kou
Created October 14, 2020 21:00
Show Gist options
  • Save kou/62cae5dcf4dcdd8f044fd33c50e8a007 to your computer and use it in GitHub Desktop.
Save kou/62cae5dcf4dcdd8f044fd33c50e8a007 to your computer and use it in GitHub Desktop.
dev/release/verify-release-candidate.sh wheels 2.0.0 2
_______________________________ test_cython_api ________________________________
tmpdir = local('/tmp/pytest-of-kou/pytest-22/test_cython_api0')
@pytest.mark.cython
def test_cython_api(tmpdir):
"""
Basic test for the Cython API.
"""
# Fail early if cython is not found
import cython # noqa
test_ld_path = os.environ.get('PYARROW_TEST_LD_PATH', '')
with tmpdir.as_cwd():
# Set up temporary workspace
pyx_file = 'pyarrow_cython_example.pyx'
shutil.copyfile(os.path.join(here, pyx_file),
os.path.join(str(tmpdir), pyx_file))
# Create setup.py file
if os.name == 'posix':
compiler_opts = ['-std=c++11']
else:
compiler_opts = []
setup_code = setup_template.format(pyx_file=pyx_file,
compiler_opts=compiler_opts,
test_ld_path=test_ld_path)
with open('setup.py', 'w') as f:
f.write(setup_code)
# ARROW-2263: Make environment with this pyarrow/ package first on the
# PYTHONPATH, for local dev environments
subprocess_env = test_util.get_modified_env_with_pythonpath()
# Compile extension module
> subprocess.check_call([sys.executable, 'setup.py',
'build_ext', '--inplace'],
env=subprocess_env)
../test-miniconda/envs/_verify_wheel-3.8/lib/python3.8/site-packages/pyarrow/tests/test_cython.py:94:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
popenargs = (['/tmp/arrow-2.0.0.WHtW8/test-miniconda/envs/_verify_wheel-3.8/bin/python3.8', 'setup.py', 'build_ext', '--inplace'],)
kwargs = {'env': {'ACLOCAL_PATH': '/tmp/local/share/aclocal', 'ARROW_TEST_DATA': '/tmp/arrow-2.0.0.WHtW8/arrow-testing/data', 'BLOCKSIZE': 'K', 'CLUTTER_IM_MODULE': 'xim', ...}}
retcode = 1
cmd = ['/tmp/arrow-2.0.0.WHtW8/test-miniconda/envs/_verify_wheel-3.8/bin/python3.8', 'setup.py', 'build_ext', '--inplace']
def check_call(*popenargs, **kwargs):
"""Run command with arguments. Wait for command to complete. If
the exit code was zero then return, otherwise raise
CalledProcessError. The CalledProcessError object will have the
return code in the returncode attribute.
The arguments are the same as for the call function. Example:
check_call(["ls", "-l"])
"""
retcode = call(*popenargs, **kwargs)
if retcode:
cmd = kwargs.get("args")
if cmd is None:
cmd = popenargs[0]
> raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/tmp/arrow-2.0.0.WHtW8/test-miniconda/envs/_verify_wheel-3.8/bin/python3.8', 'setup.py', 'build_ext', '--inplace']' returned non-zero exit status 1.
../test-miniconda/envs/_verify_wheel-3.8/lib/python3.8/subprocess.py:364: CalledProcessError
----------------------------- Captured stdout call -----------------------------
Compiling pyarrow_cython_example.pyx because it changed.
[1/1] Cythonizing pyarrow_cython_example.pyx
Extension module: <distutils.extension.Extension('pyarrow_cython_example') at 0x7f904ea83fd0> ['/tmp/arrow-2.0.0.WHtW8/test-miniconda/envs/_verify_wheel-3.8/lib/python3.8/site-packages/numpy/core/include', '/tmp/arrow-2.0.0.WHtW8/test-miniconda/envs/_verify_wheel-3.8/lib/python3.8/site-packages/pyarrow/include'] ['arrow', 'arrow_python'] ['/tmp/arrow-2.0.0.WHtW8/test-miniconda/envs/_verify_wheel-3.8/lib/python3.8/site-packages/pyarrow']
running build_ext
building 'pyarrow_cython_example' extension
creating build
creating build/temp.linux-x86_64-3.8
gcc -pthread -B /tmp/arrow-2.0.0.WHtW8/test-miniconda/envs/_verify_wheel-3.8/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/tmp/arrow-2.0.0.WHtW8/test-miniconda/envs/_verify_wheel-3.8/lib/python3.8/site-packages/numpy/core/include -I/tmp/arrow-2.0.0.WHtW8/test-miniconda/envs/_verify_wheel-3.8/lib/python3.8/site-packages/pyarrow/include -I/tmp/arrow-2.0.0.WHtW8/test-miniconda/envs/_verify_wheel-3.8/include/python3.8 -c pyarrow_cython_example.cpp -o build/temp.linux-x86_64-3.8/pyarrow_cython_example.o -std=c++11
g++ -pthread -shared -B /tmp/arrow-2.0.0.WHtW8/test-miniconda/envs/_verify_wheel-3.8/compiler_compat -L/tmp/arrow-2.0.0.WHtW8/test-miniconda/envs/_verify_wheel-3.8/lib -Wl,-rpath=/tmp/arrow-2.0.0.WHtW8/test-miniconda/envs/_verify_wheel-3.8/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.8/pyarrow_cython_example.o -L/tmp/arrow-2.0.0.WHtW8/test-miniconda/envs/_verify_wheel-3.8/lib/python3.8/site-packages/pyarrow -larrow -larrow_python -o /tmp/pytest-of-kou/pytest-22/test_cython_api0/pyarrow_cython_example.cpython-38-x86_64-linux-gnu.so
----------------------------- Captured stderr call -----------------------------
cc1plus: warning: command-line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
pyarrow_cython_example.cpp:3429:52: warning: ‘__pyx_f_7pyarrow_3lib_pyarrow_unwrap_sparse_csf_tensor’ defined but not used [-Wunused-variable]
3429 | static std::shared_ptr< arrow::SparseCSFTensor> (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_sparse_csf_tensor)(PyObject *); /*proto*/
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyarrow_cython_example.cpp:3428:52: warning: ‘__pyx_f_7pyarrow_3lib_pyarrow_unwrap_sparse_csc_matrix’ defined but not used [-Wunused-variable]
3428 | static std::shared_ptr< arrow::SparseCSCMatrix> (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_sparse_csc_matrix)(PyObject *); /*proto*/
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyarrow_cython_example.cpp:3427:52: warning: ‘__pyx_f_7pyarrow_3lib_pyarrow_unwrap_sparse_csr_matrix’ defined but not used [-Wunused-variable]
3427 | static std::shared_ptr< arrow::SparseCSRMatrix> (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_sparse_csr_matrix)(PyObject *); /*proto*/
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyarrow_cython_example.cpp:3426:52: warning: ‘__pyx_f_7pyarrow_3lib_pyarrow_unwrap_sparse_coo_tensor’ defined but not used [-Wunused-variable]
3426 | static std::shared_ptr< arrow::SparseCOOTensor> (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_sparse_coo_tensor)(PyObject *); /*proto*/
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyarrow_cython_example.cpp:3425:43: warning: ‘__pyx_f_7pyarrow_3lib_pyarrow_unwrap_tensor’ defined but not used [-Wunused-variable]
3425 | static std::shared_ptr< arrow::Tensor> (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_tensor)(PyObject *); /*proto*/
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyarrow_cython_example.cpp:3424:42: warning: ‘__pyx_f_7pyarrow_3lib_pyarrow_unwrap_table’ defined but not used [-Wunused-variable]
3424 | static std::shared_ptr< arrow::Table> (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_table)(PyObject *); /*proto*/
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyarrow_cython_example.cpp:3423:43: warning: ‘__pyx_f_7pyarrow_3lib_pyarrow_unwrap_schema’ defined but not used [-Wunused-variable]
3423 | static std::shared_ptr< arrow::Schema> (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_schema)(PyObject *); /*proto*/
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyarrow_cython_example.cpp:3422:42: warning: ‘__pyx_f_7pyarrow_3lib_pyarrow_unwrap_field’ defined but not used [-Wunused-variable]
3422 | static std::shared_ptr< arrow::Field> (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_field)(PyObject *); /*proto*/
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyarrow_cython_example.cpp:3421:45: warning: ‘__pyx_f_7pyarrow_3lib_pyarrow_unwrap_data_type’ defined but not used [-Wunused-variable]
3421 | static std::shared_ptr< arrow::DataType> (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_data_type)(PyObject *); /*proto*/
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyarrow_cython_example.cpp:3420:43: warning: ‘__pyx_f_7pyarrow_3lib_pyarrow_unwrap_buffer’ defined but not used [-Wunused-variable]
3420 | static std::shared_ptr< arrow::Buffer> (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_buffer)(PyObject *); /*proto*/
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyarrow_cython_example.cpp:3419:48: warning: ‘__pyx_f_7pyarrow_3lib_pyarrow_unwrap_batch’ defined but not used [-Wunused-variable]
3419 | static std::shared_ptr< arrow::RecordBatch> (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_batch)(PyObject *); /*proto*/
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyarrow_cython_example.cpp:3418:49: warning: ‘__pyx_f_7pyarrow_3lib_pyarrow_unwrap_chunked_array’ defined but not used [-Wunused-variable]
3418 | static std::shared_ptr< arrow::ChunkedArray> (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_chunked_array)(PyObject *); /*proto*/
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyarrow_cython_example.cpp:3416:43: warning: ‘__pyx_f_7pyarrow_3lib_pyarrow_unwrap_scalar’ defined but not used [-Wunused-variable]
3416 | static std::shared_ptr< arrow::Scalar> (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_scalar)(PyObject *); /*proto*/
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyarrow_cython_example.cpp:3415:20: warning: ‘__pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_csf_tensor’ defined but not used [-Wunused-variable]
3415 | static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_csf_tensor)(std::shared_ptr< arrow::SparseCSFTensor> const &); /*proto*/
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyarrow_cython_example.cpp:3414:20: warning: ‘__pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_csc_matrix’ defined but not used [-Wunused-variable]
3414 | static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_csc_matrix)(std::shared_ptr< arrow::SparseCSCMatrix> const &); /*proto*/
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyarrow_cython_example.cpp:3413:20: warning: ‘__pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_csr_matrix’ defined but not used [-Wunused-variable]
3413 | static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_csr_matrix)(std::shared_ptr< arrow::SparseCSRMatrix> const &); /*proto*/
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyarrow_cython_example.cpp:3412:20: warning: ‘__pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_coo_tensor’ defined but not used [-Wunused-variable]
3412 | static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_coo_tensor)(std::shared_ptr< arrow::SparseCOOTensor> const &); /*proto*/
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyarrow_cython_example.cpp:3411:20: warning: ‘__pyx_f_7pyarrow_3lib_pyarrow_wrap_tensor’ defined but not used [-Wunused-variable]
3411 | static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_tensor)(std::shared_ptr< arrow::Tensor> const &); /*proto*/
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyarrow_cython_example.cpp:3410:20: warning: ‘__pyx_f_7pyarrow_3lib_pyarrow_wrap_table’ defined but not used [-Wunused-variable]
3410 | static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_table)(std::shared_ptr< arrow::Table> const &); /*proto*/
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyarrow_cython_example.cpp:3409:20: warning: ‘__pyx_f_7pyarrow_3lib_pyarrow_wrap_schema’ defined but not used [-Wunused-variable]
3409 | static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_schema)(std::shared_ptr< arrow::Schema> const &); /*proto*/
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyarrow_cython_example.cpp:3408:20: warning: ‘__pyx_f_7pyarrow_3lib_pyarrow_wrap_resizable_buffer’ defined but not used [-Wunused-variable]
3408 | static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_resizable_buffer)(std::shared_ptr< arrow::ResizableBuffer> const &); /*proto*/
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyarrow_cython_example.cpp:3407:20: warning: ‘__pyx_f_7pyarrow_3lib_pyarrow_wrap_field’ defined but not used [-Wunused-variable]
3407 | static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_field)(std::shared_ptr< arrow::Field> const &); /*proto*/
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyarrow_cython_example.cpp:3406:20: warning: ‘__pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type’ defined but not used [-Wunused-variable]
3406 | static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type)(std::shared_ptr< arrow::DataType> const &); /*proto*/
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyarrow_cython_example.cpp:3405:20: warning: ‘__pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer’ defined but not used [-Wunused-variable]
3405 | static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer)(std::shared_ptr< arrow::Buffer> const &); /*proto*/
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyarrow_cython_example.cpp:3404:20: warning: ‘__pyx_f_7pyarrow_3lib_pyarrow_wrap_batch’ defined but not used [-Wunused-variable]
3404 | static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_batch)(std::shared_ptr< arrow::RecordBatch> const &); /*proto*/
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyarrow_cython_example.cpp:3403:20: warning: ‘__pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array’ defined but not used [-Wunused-variable]
3403 | static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array)(std::shared_ptr< arrow::ChunkedArray> const &); /*proto*/
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyarrow_cython_example.cpp:3401:20: warning: ‘__pyx_f_7pyarrow_3lib_pyarrow_wrap_scalar’ defined but not used [-Wunused-variable]
3401 | static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_scalar)(std::shared_ptr< arrow::Scalar> const &); /*proto*/
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from pyarrow_cython_example.cpp:658:
/tmp/arrow-2.0.0.WHtW8/test-miniconda/envs/_verify_wheel-3.8/include/python3.8/datetime.h:189:25: warning: ‘PyDateTimeAPI’ defined but not used [-Wunused-variable]
189 | static PyDateTime_CAPI *PyDateTimeAPI = NULL;
| ^~~~~~~~~~~~~
/tmp/arrow-2.0.0.WHtW8/test-miniconda/envs/_verify_wheel-3.8/compiler_compat/ld: cannot find -larrow
/tmp/arrow-2.0.0.WHtW8/test-miniconda/envs/_verify_wheel-3.8/compiler_compat/ld: cannot find -larrow_python
collect2: error: ld returned 1 exit status
error: command 'g++' failed with exit status 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment