diff --git a/casacore/measures/__init__.py b/casacore/measures/__init__.py index 7bb4b3e..762700e 100755 --- a/casacore/measures/__init__.py +++ b/casacore/measures/__init__.py @@ -624,7 +624,7 @@ def getvalue(self, v): if not is_measure(v): raise TypeError('Incorrect input type for getvalue()') import re - rx = re.compile("m\d+") + rx = re.compile(r"m\d+") out = [] keys = list(v.keys()) keys.sort() diff --git a/setup.py b/setup.py index 7bb3650..fac96fa 100755 --- a/setup.py +++ b/setup.py @@ -3,6 +3,7 @@ Setup script for the CASACORE python wrapper. """ import os +import subprocess import sys import warnings from setuptools import setup, Extension, find_packages @@ -52,7 +53,17 @@ def find_library_file(libname): if 'LD_LIBRARY_PATH' in os.environ: lib_dirs += os.environ['LD_LIBRARY_PATH'].split(':') - + # Look for Homebrewed libraries + try: + homebrew_prefix = subprocess.run( + ['brew', '--prefix'], + capture_output=True, + check=True, + text=True + ).stdout.strip() + lib_dirs.append(join(homebrew_prefix, 'lib')) + except (subprocess.CalledProcessError, FileNotFoundError): + pass # Append default search path (not a complete list) lib_dirs += [join(sys.prefix, 'lib'), '/usr/local/lib',