mkleehammer / pyodbc

Python ODBC bridge
https://github.com/mkleehammer/pyodbc/wiki
MIT No Attribution
2.88k stars 562 forks source link

setup.py doesn't use `HOMEBREW_PREFIX` to find Homebrew (sometimes it can't find it) #1211

Open RA80533 opened 1 year ago

RA80533 commented 1 year ago

Issue

Homebrew installs in either a default directory (based on factors such as the macOS version installing Homebrew, the Homebrew version being installed, etc.) or a user-specified directory.

Homebrew provides a HOMEBREW_PREFIX environment variable in order to locate where it's installed.

While setup.py takes a few guesses as to where Homebrew is located ([setup.py#L213-L219]), it does not use the environment variable which is likely to have the location:

https://github.com/mkleehammer/pyodbc/blob/7b4e27781c7f1b75995ecca73d3018c929f4adef/setup.py#L213-L219

[setup.py#L213-L219]: https://github.com/mkleehammer/pyodbc/blob/7b4e27781c7f1b75995ecca73d3018c929f4adef/setup.py#L213-L219

If the user installed Homebrew in a user-specified directory, setup.py is not able to find Homebrew and fails to run.