You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/11/16 19:49:04 UTC

[GitHub] [arrow] kou commented on a diff in pull request #14656: ARROW-18340: [Python] PyArrow C++ header files no longer always included in installed pyarrow

kou commented on code in PR #14656:
URL: https://github.com/apache/arrow/pull/14656#discussion_r1024442125


##########
python/setup.py:
##########
@@ -436,19 +436,23 @@ def copy_libs(dir):
             else:
                 build_prefix = self.build_type
 
+            pyarrow_include = pjoin(build_lib, 'pyarrow', 'include')
+            # Move Arrow C++ headers to pyarrow/include
             if self.bundle_arrow_cpp or self.bundle_arrow_cpp_headers:
                 arrow_cpp_include = pjoin(build_prefix, 'include')
                 print('Bundling includes: ' + arrow_cpp_include)
-                pyarrow_include = pjoin(build_lib, 'pyarrow', 'include')
                 if os.path.exists(pyarrow_include):
                     shutil.rmtree(pyarrow_include)
                 shutil.move(arrow_cpp_include, pyarrow_include)
 
-                # pyarrow/include file is first deleted in the previous step
-                # so we need to add the PyArrow C++ include folder again
-                pyarrow_cpp_include = pjoin(pyarrow_cpp_home, 'include')
-                shutil.move(pjoin(pyarrow_cpp_include, 'arrow', 'python'),
-                            pjoin(pyarrow_include, 'arrow', 'python'))
+            # Move PyArrow headers to pyarrow/include
+            pyarrow_cpp_include = pjoin(pyarrow_cpp_home, 'include')
+            print('Moving PyArrow C++ includes: ' +
+                  pjoin(pyarrow_include, 'arrow', 'python'))
+            if os.path.exists(pjoin(pyarrow_include, 'arrow', 'python')):
+                shutil.rmtree(pjoin(pyarrow_include, 'arrow', 'python'))
+            shutil.move(pjoin(pyarrow_cpp_include, 'arrow', 'python'),
+                        pjoin(pyarrow_include, 'arrow', 'python'))

Review Comment:
   Can we define a variable for `pjoin(pyarrow_include, 'arrow', 'python')` because it's used multiple times?



-- 
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-unsubscribe@arrow.apache.org

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