eli-schwartz commented on code in PR #45854:
URL: https://github.com/apache/arrow/pull/45854#discussion_r2016926861


##########
python/pyarrow/meson.build:
##########
@@ -0,0 +1,344 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+py = import('python').find_installation(pure: false)
+
+# When NumPy 2.0 becomes the minimum we can remove the
+# custom location check
+numpy_dep = dependency('numpy', required: false)
+if not numpy_dep.found()
+    incdir_numpy = run_command(
+        py,
+        [
+            '-c',
+            '''
+import os
+import numpy as np
+try:
+    # Check if include directory is inside the pyarrow dir
+    # e.g. a venv created inside the pyarrow dir
+    # If so, convert it to a relative path
+    incdir = os.path.relpath(np.get_include())
+except Exception:
+    incdir = np.get_include()
+print(incdir)
+''',
+        ],
+        check: true,
+    ).stdout().strip()
+
+    numpy_dep = declare_dependency(include_directories: incdir_numpy)
+endif
+
+cython_args = ['--include-dir', meson.current_source_dir()]
+if get_option('buildtype') in ['debug', 'debugoptimized']
+    cython_args += ['--gdb']
+endif
+
+pyarrow_srcs = files(
+    'src/arrow/python/arrow_to_pandas.cc',
+    'src/arrow/python/benchmark.cc',
+    'src/arrow/python/common.cc',
+    'src/arrow/python/datetime.cc',
+    'src/arrow/python/decimal.cc',
+    'src/arrow/python/extension_type.cc',
+    'src/arrow/python/gdb.cc',
+    'src/arrow/python/helpers.cc',
+    'src/arrow/python/inference.cc',
+    'src/arrow/python/io.cc',
+    'src/arrow/python/ipc.cc',
+    'src/arrow/python/numpy_convert.cc',
+    'src/arrow/python/numpy_init.cc',
+    'src/arrow/python/numpy_to_arrow.cc',
+    'src/arrow/python/pyarrow.cc',
+    'src/arrow/python/python_test.cc',
+    'src/arrow/python/python_to_arrow.cc',
+    'src/arrow/python/udf.cc',
+)
+
+# TODO: these are optional components so should detect if needed
+# if needs_csv
+pyarrow_srcs += files('src/arrow/python/csv.cc')
+#endif
+# if needs_filesystem
+pyarrow_srcs += files('src/arrow/python/filesystem.cc')
+#endif
+
+cython_generated_headers = custom_target(

Review Comment:
   The `cythonize` program is a setuptools setup.py wrapper that drives 
compilation.
   
   When integrating the Cython project with another build system, always use 
`cython` instead. It has an `-o @OUTPUT@` option.



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to