tox-dev / platformdirs

A small Python module for determining appropriate platform-specific dirs, e.g. a "user data dir".
https://platformdirs.readthedocs.io
MIT License
593 stars 51 forks source link

Add support for Homebrew-installed software #232

Closed singingwolfboy closed 1 year ago

singingwolfboy commented 1 year ago

Fixes #220. For software installed by and managed by Homebrew, site_data_dir and site_config_dir should point to the Homebrew-managed directories. (I added site_cache_dir as well just because it was easy to add.) This also means that the multipath option is now relevant for software running on macOS, as well as Linux/Unix.

Note that Homebrew actually has three default prefixes: one for Intel macOS computers, one for Apple Silicon macOS computers, and one for Linux computers. This pull request only addresses Apple Silicon macOS computers, where the default prefix is /opt/homebrew. I did this for several reasons:

  1. On macOS, /opt/homebrew is the clearest indication that the software is indeed running under Homebrew; /usr/local could mean user-installed software.
  2. It will probably be awhile before this change affects end-users; by that time, Intel Macs may no longer be supported.
  3. Very, very few people use Homebrew on Linux; it doesn't seem worth it to support that use-case (yet).

Thoughts?

singingwolfboy commented 1 year ago

All CI runners are now passing on my pull request to my own fork. Could you please run the workflow again?

singingwolfboy commented 1 year ago

I made the changes requested. Could I get another review, please?