Hello Homebrew Community!

I’m writing my first brew formula, for an internal tool at my workplace that’s written in Python. Following the advice in https://github.com/Homebrew/brew/blob/master/docs/Formula-Cookbook.md and https://github.com/Homebrew/brew/blob/master/docs/Python-for-Formula-Authors.md, my formula defines resource stanzas for all of the Python packages that we depend on. My question is about the types of Python distributions that may be used.

Python packages can be distributed as source distributions in `.tar.gz`

format, or built/wheel distributions in `.whl`

(basically `.zip`

) format. The docs for Python formula authors seem to indicate that source distributions are preferable, and indeed, the `venv.pip_install`

command will by default refuse to install `.whl`

distributions.

I have noticed that when I use 100% source distributions, my formula takes about 10 minutes to install, because it has to compile a bunch of C. However, if I skip the formula and use `pip`

in a clean virtual environment to install my package from requirement specifiers, allowing it to select `.whl`

distributions when available, the install process takes about 2 minutes. This is a huge performance difference, so I’m sure my users would prefer the formula to use `.whl`

distributions when available.

Also, the docs are somewhat vague on this requirement; while it is clear that the `url`

in a formula should download a source distribution, should all of the `resource`

s in a formula refer to source distributions? Why is `venv.pip_install`

programmed to refuse to install `.whl`

s? Will puppies and kittens really die if I have binary dependencies?

I’d appreciate any advice or insight.