You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ap...@apache.org on 2019/07/24 11:23:13 UTC

[arrow] branch master updated: ARROW-6016: [Python] Fix get_library_dirs() when Arrow installed as a system package

This is an automated email from the ASF dual-hosted git repository.

apitrou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 5c005fb  ARROW-6016: [Python] Fix get_library_dirs() when Arrow installed as a system package
5c005fb is described below

commit 5c005fbca3dc5b5ae4cae524884894bccd1db25e
Author: Antoine Pitrou <an...@python.org>
AuthorDate: Wed Jul 24 13:22:58 2019 +0200

    ARROW-6016: [Python] Fix get_library_dirs() when Arrow installed as a system package
    
    Presumably this should fix the issue, though I can't check.
    
    Closes #4926 from pitrou/ARROW-6016-py-system-library-dir and squashes the following commits:
    
    b5bccc5ce <Antoine Pitrou> Raise rather than assert
    6bc238a7b <Antoine Pitrou> ARROW-6016:  Fix get_library_dirs() when Arrow installed as a system package
    
    Authored-by: Antoine Pitrou <an...@python.org>
    Signed-off-by: Antoine Pitrou <an...@python.org>
---
 python/pyarrow/__init__.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/python/pyarrow/__init__.py b/python/pyarrow/__init__.py
index bc49e17..afe0636 100644
--- a/python/pyarrow/__init__.py
+++ b/python/pyarrow/__init__.py
@@ -262,8 +262,14 @@ def get_library_dirs():
         if _has_pkg_config(pkgname):
             library_dir = _read_pkg_config_variable(pkgname,
                                                     ["--libs-only-L"])
-            assert library_dir.startswith("-L")
-            append_library_dir(library_dir[2:])
+            # pkg-config output could be empty if Arrow is installed
+            # as a system package.
+            if library_dir:
+                if not library_dir.startswith("-L"):
+                    raise ValueError(
+                        "pkg-config --libs-only-L returned unexpected "
+                        "value {0!r}".format(library_dir))
+                append_library_dir(library_dir[2:])
 
     if _sys.platform == 'win32':
         # TODO(wesm): Is this necessary, or does setuptools within a conda