kou commented on issue #15016: URL: https://github.com/apache/arrow/issues/15016#issuecomment-1356873615
`test_get_include()` is failed because pyarrow package doesn't bundle Apache Arrow C++ headers ( https://github.com/apache/arrow/blob/2c768a1767c0d7b33644910e0e96a949bc6f6f42/dev/tasks/conda-recipes/arrow-cpp/build-pyarrow.sh#L11 ) and `get_include()` only returns pyarrow's include directory. I think that `test_get_include()` should check `arrow/python/api.h` not `arrow/api.h`. I also think that we need one more related API: `pyarrow.get_include_dirs()` It returns all include directories that pyarrow C++ API users need. It means that `pyarrow.get_include_dirs()` may return multiple paths that are for Apache Arrow C++ and pyarrow: ```diff diff --git a/python/pyarrow/tests/test_misc.py b/python/pyarrow/tests/test_misc.py index 457d7d396a..3725ddf4ac 100644 --- a/python/pyarrow/tests/test_misc.py +++ b/python/pyarrow/tests/test_misc.py @@ -29,6 +29,16 @@ def test_get_include(): assert os.path.exists(os.path.join(include_dir, 'arrow', 'api.h')) +def test_get_include_dirs(): + include_dirs = pa.get_include_dirs() + assert any([os.path.exists(os.path.join(include_dir, 'arrow', 'api.h')) + for include_dir + in include_dirs]) + assert any([os.path.exists(os.path.join(include_dir, 'arrow', 'python', 'api.h')) + for include_dir + in include_dirs]) + + @pytest.mark.skipif('sys.platform != "win32"') def test_get_library_dirs_win32(): assert any(os.path.exists(os.path.join(directory, 'arrow.lib')) ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
