I wanted to remove python@3.9 in Homebrew since I use python@3.10 more often, but Homebrew returned the following error:
Error: Refusing to uninstall /usr/local/Cellar/python@3.9/3.9.14
because it is required by cairo and libass, which are currently installed.
You can override this and force removal with:
brew uninstall --ignore-dependencies python@3.9
Okay, so cairo and libass require python@3.9 to work... right?
When I ran brew deps cairo, it returned the following:
ca-certificates
cairo
fontconfig
freetype
fribidi
gdbm
gettext
glib
gobject-introspection
graphite2
harfbuzz
icu4c
libffi
libpng
libpthread-stubs
libx11
libxau
libxcb
libxdmcp
libxext
libxrender
lzo
mpdecimal
openssl@1.1
pcre
pixman
pkg-config
python@3.9
readline
sqlite
xorgproto
xz
But when I added the --tree flag, it returned the following:
cairo
├── fontconfig
│ └── freetype
│ └── libpng
├── freetype
│ └── libpng
├── glib
│ ├── gettext
│ └── pcre
├── libpng
├── libx11
│ ├── libxcb
│ │ ├── libpthread-stubs
│ │ │ └── pkg-config
│ │ ├── libxau
│ │ │ └── xorgproto
│ │ └── libxdmcp
│ │ └── xorgproto
│ └── xorgproto
├── libxcb
│ ├── libpthread-stubs
│ │ └── pkg-config
│ ├── libxau
│ │ └── xorgproto
│ └── libxdmcp
│ └── xorgproto
├── libxext
│ ├── libx11
│ │ ├── libxcb
│ │ │ ├── libpthread-stubs
│ │ │ │ └── pkg-config
│ │ │ ├── libxau
│ │ │ │ └── xorgproto
│ │ │ └── libxdmcp
│ │ │ └── xorgproto
│ │ └── xorgproto
│ └── xorgproto
├── libxrender
│ ├── libx11
│ │ ├── libxcb
│ │ │ ├── libpthread-stubs
│ │ │ │ └── pkg-config
│ │ │ ├── libxau
│ │ │ │ └── xorgproto
│ │ │ └── libxdmcp
│ │ │ └── xorgproto
│ │ └── xorgproto
│ └── xorgproto
├── lzo
└── pixman
Notice how python@3.9 isn't in the dependency tree?
libass was the same; the dependency list included python@3.9, but the dependency tree did not.
The Homebrew documentation for cairo and libass seems to follow the dependency tree information (albeit only showing the top-level leaves), and python@3.9 doesn't seem to appear anywhere.
It'd be helpful if someone could explain the difference in the outputs and whether it is safe for me to remove python@3.9 despite the warning.
By the way, I don't use cairo and libass; they are just dependencies for ffmpeg.