jfowkes / pycutest

Python interface to CUTEst
https://jfowkes.github.io/pycutest/
GNU General Public License v3.0
28 stars 11 forks source link

Use homebrew prefix for fallback paths on macOS #46

Closed jfowkes closed 1 year ago

jfowkes commented 1 year ago

The fallback paths on macOS should not be hardcoded with /usr/local/ as this will break on the new ARM macs since they do not use /usr/local/ by default (c.f. #39).

This PR switches to querying homebrew for its install location in the same way as #39 does in install_scripts.py (this still returns /usr/local/ on my Intel mac install).

This also resolves #45

jfowkes commented 1 year ago

@lindonroberts would you be able to do a quick review? Should be a very easy one!

lindonroberts commented 1 year ago

@jfowkes - this looks good. Two very minor things to consider:

jfowkes commented 1 year ago

Thanks @lindonroberts, I have updated the path comments to read HOMEBREW_PREFIX/...

Regarding setting homebrew_path=None, did you mean setting homebrew_prefix=None? Since hombrew_path is a local variable within each darwin branch it can't cause an undefined variable error. On the other hand, homebrew_prefix has global scope when defined (only in the darwin branch) so this could easily cause undefined variable errors in future.

lindonroberts commented 1 year ago

@jfowkes - yes, I meant to say homebrew_prefix

jfowkes commented 1 year ago

@lindonroberts great I've initialised homebrew_prefix to None, this is now ready for merge if you're happy?