Skip to content

Commit

Permalink
docs: various tweaks.
Browse files Browse the repository at this point in the history
Adjust various maintainer and contributor-focused documents after
recent maintainer conversations and generally anything I noticed was
wrong or outdated as I went through these.
  • Loading branch information
MikeMcQuaid committed Dec 6, 2023
1 parent ab6a7ed commit ae94d9e
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 16 deletions.
8 changes: 5 additions & 3 deletions docs/Acceptable-Formulae.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ We now accept versioned formulae as long as they [meet the requirements](Version

### We don’t like tools that upgrade themselves

Software that can upgrade itself does not integrate well with Homebrew's own upgrade functionality. The self-update functionality should be disabled (while minimising complication to the formula).
Software that can upgrade itself does not integrate well with Homebrew formulae's own upgrade functionality. The self-update functionality should be disabled (while minimising complication to the formula). It's fine (and well-supported) for Casks.

### We don’t like install scripts that download unversioned things

We don't like install scripts that are pulling from the master branch of Git repositories or unversioned, unchecksummed tarballs. These should use `resource` blocks with specific revisions or checksummed tarballs instead. Note that we now allow tools like `cargo`, `gem` and `pip` to download specifically versioned libraries during installation.
We don't like install scripts that are pulling from the master branch of Git repositories or unversioned, unchecksummed tarballs. These should ideally use `resource` blocks with specific revisions or checksummed tarballs instead. Note that we now allow tools like `cargo`, `gem` and `pip` to download versioned libraries during installation. There's no need to reproduce the functionality of any language package manager with `resource` blocks when we can call it instead.

### We don’t like binary formulae

Expand Down Expand Up @@ -86,6 +86,8 @@ Homebrew formulae should avoid having multiple, separate, upstream projects bund
For more info see [Debian's](https://www.debian.org/doc/debian-policy/ch-source.html#s-embeddedfiles) and [Fedora's](https://docs.fedoraproject.org/en-US/packaging-guidelines/#bundling) stances on this.

Increasingly, though: this can be (too) hard. Homebrew's primary mission is to be useful rather than ideologically pure. If we cannot package something without using vendored upstream versions: so be it; better to have packaged software in Homebrew than not.

## Sometimes there are exceptions

Even if all criteria are met we may not accept the formula. Documentation tends to lag behind current decision-making. Although some rejections may seem arbitrary or strange they are based on years of experience making Homebrew work acceptably for our users.
Even if all criteria are met we may not accept the formula. Even if some criteria are not met we may accept the formula. New formulae are held to a higher standard than existing formulae. Documentation will lag behind current decision-making. Although some rejections may seem arbitrary or strange they are based on years of experience making Homebrew work acceptably for our users.
2 changes: 1 addition & 1 deletion docs/Adding-Software-to-Homebrew.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Adding Software To Homebrew

Is your favorite software missing from Homebrew? Then you're the perfect person to resolve this problem.
Is your favourite software missing from Homebrew? Then you're the perfect person to resolve this problem.

If you want to add software that is either closed source or a GUI-only program, you will want to follow the guide for [Casks](#casks). Otherwise follow the guide for [Formulae](#formulae) (see also: [Homebrew Terminology](Formula-Cookbook.md#homebrew-terminology)).

Expand Down
2 changes: 1 addition & 1 deletion docs/Homebrew-homebrew-cask-Maintainer-Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Note that unlike formulae, casks do not consider the `sha256` stanza to be a mea

## Merging

In general, using GitHub's "Squash and Merge" button is the best way to merge a PR. This can be used when the PR modifies only one cask, regardless of the number of commits or whether the commit message format is correct. When merging using this method, the commit message can be modified if needed. Usually, version bump commit messages follow the form `Update CASK from OLD_VERSION to NEW_VERSION`.
In general, using GitHub's "Merge" button is the best way to merge a PR. This can be used when the PR modifies only one cask, regardless of the number of commits or whether the commit message format is correct. When merging using this method, the commit message can be modified if needed. Usually, version bump commit messages follow the form `Update CASK from OLD_VERSION to NEW_VERSION`.

If the PR modifies multiple casks, use the "Rebase and Merge" button to merge the PR. This will use the commit messages from the PR, so make sure that they are appropriate before merging. If needed, checkout the PR, squash/reword the commits and force-push back to the PR branch to ensure the proper commit format.

Expand Down
8 changes: 5 additions & 3 deletions docs/Maintainer-Guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ Homebrew aims to be the missing package manager for macOS (and Linux). Its prima

It may be enough to refer to an issue ticket, but make sure changes and context are clear enough so that anyone reading them for the first time can make sense of them. You don't want code you wrote to be removed because the someone new doesn’t understand why it’s there. Regressions suck.

This also applies to issue and PR bodies. Be as explicit as possible. If a pull request is part of a larger initiative: link to a relevant tracking issue. If there isn't a tracking issue yet: create one to improve communication and get consensus.

### Don’t allow bloated diffs

Amend a cherry-pick to remove commits that are only changes in whitespace. They are not acceptable because our history is important and `git blame` should be useful.
Expand All @@ -37,9 +39,9 @@ Whitespace corrections (to Ruby standard etc.) are allowed (in fact this is a go

### Closing issues/PRs

Maintainers (including the lead maintainer) should not close issues or pull requests (note a merge is not considered a close in this case) opened by other maintainers unless they are stale (i.e. have seen no updates for 28 days) in which case they can be closed by any maintainer. Any maintainer is encouraged to reopen a closed issue when they wish to do additional work on the issue.
Maintainers (including the project leader) should not close issues or pull requests (note a merge is not considered a close in this case) opened by other maintainers unless they are stale in which case they can be closed by any maintainer. Any maintainer is encouraged to reopen a closed issue when they wish to do additional work on the issue.

Any maintainer can merge any PR they have carefully reviewed and is passing CI that has been opened by any other maintainer. If you do not wish to have other maintainers merge your PRs: please use the `do not merge` label to indicate that until you're ready to merge it yourself.
Any maintainer can merge any PR they have carefully reviewed and is passing CI that has been opened by any other maintainer. If you do not wish to have other maintainers merge your PRs: please use the draft pull request status to indicate that until you're ready to merge it yourself.

## Reverting PRs

Expand Down Expand Up @@ -69,6 +71,6 @@ All communication should ideally occur in public on GitHub. Where this is not po

This makes it easier for other maintainers, contributors and users to follow along with what we're doing (and, more importantly, why we're doing it) and means that decisions have a linkable URL.

All maintainers (and lead maintainer) communication through any medium is bound by [Homebrew's Code of Conduct](https://github.com/Homebrew/.github/blob/HEAD/CODE_OF_CONDUCT.md#code-of-conduct). Abusive behaviour towards other maintainers, contributors or users will not be tolerated; the maintainer will be given a warning and if their behaviour continues they will be removed as a maintainer.
All maintainers (and project leader) communication through any medium is bound by [Homebrew's Code of Conduct](https://github.com/Homebrew/.github/blob/HEAD/CODE_OF_CONDUCT.md#code-of-conduct). Abusive behaviour towards other maintainers, contributors or users will not be tolerated; the maintainer will be given a warning and if their behaviour continues they will be removed as a maintainer.

Maintainers should feel free to pleasantly disagree with the work and decisions of other maintainers. Healthy, friendly, technical disagreement between maintainers is actively encouraged and should occur in public on the issue tracker to make the project better. Interpersonal issues should be handled privately in Slack, ideally with moderation. If work or decisions are insufficiently documented or explained any maintainer or contributor should feel free to ask for clarification. No maintainer may ever justify a decision with e.g. "because I say so" or "it was I who did X" alone. Off-topic discussions on the issue tracker, [bike-shedding](https://en.wikipedia.org/wiki/Law_of_triviality) and personal attacks are forbidden.
8 changes: 8 additions & 0 deletions docs/Maintainers-Avoiding-Burnout.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ realise that they aren't going to be resolved or merged. This is kinder than
deciding this after a long period of review. Our issue tracker should reflect
work to be done.

## 5. Slow Down

We're a volunteer-run open source project used by a lot of people. That can mean
that it feels like there's a lot of pressure to get a fix, package or project
completed ASAP. Try to not feel this pressure; slow down, focus on Homebrew
being enjoyable. If in doubt: over-communicate your decision making. A revert
can always be done now and a proper fix done tomorrow.

---

_Thanks to <https://gist.github.com/ryanflorence/124070e7c4b3839d4573> which influenced this document._
12 changes: 4 additions & 8 deletions docs/Python-for-Formula-Authors.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Python libraries exist to be imported by other Python modules; they are often de

Bindings are a special case of libraries that allow Python code to interact with a library or application implemented in another language.

Homebrew is happy to accept applications that are built in Python, whether the apps are available from PyPI or not. Homebrew generally won't accept libraries that can be installed correctly with `pip install foo`. Bindings may be installed for packages that provide them, especially if equivalent functionality isn't available through pip.
Homebrew is happy to accept applications that are built in Python, whether the apps are available from PyPI or not. Homebrew generally won't accept libraries that can be installed correctly with `pip install foo`. Bindings may be installed for packages that provide them, especially if equivalent functionality isn't available through pip. Similarly, libraries that have non-trivial amounts of native code and have a long compilation as a result can be good candidates. If in doubt, though: do not package libraries.

Applications should unconditionally bundle all their Python-language dependencies and libraries and should install any unsatisfied dependencies; these strategies are discussed in depth in the following sections.

Expand All @@ -18,8 +18,6 @@ Applications should unconditionally bundle all their Python-language dependencie

Formulae for apps that require Python 3 **should** declare an unconditional dependency on `"[email protected]"`. These apps **must** work with the current Homebrew Python 3.x formula.

Applications that are compatible with Python 2 **should** use the Apple-provided system Python in `/usr/bin` on systems that provide Python 2.7. No explicit Python dependency is needed since `/usr/bin` is always in `PATH` for Homebrew formulae.

### Installing applications

Applications should be installed into a Python [virtualenv](https://virtualenv.pypa.io/en/stable/) environment rooted in `libexec`. This prevents the app's Python modules from contaminating the system `site-packages` and vice versa.
Expand Down Expand Up @@ -119,8 +117,6 @@ in case you need to do different things for different resources.

To add bindings for Python 3, please add `depends_on "[email protected]"` to work with the current Homebrew Python 3.x formula.

Build Python 2 bindings with the system Python by default (don't add an option) and they should be usable with any binary-compatible Python. If that isn't the case, it's an upstream bug; [here's some advice for resolving it](https://blog.tim-smith.us/2015/09/python-extension-modules-os-x/).

### Dependencies for bindings

Bindings should follow the same advice for Python module dependencies as libraries; see below for more.
Expand All @@ -147,11 +143,11 @@ Sometimes we have to edit a `Makefile` on-the-fly to use our prefix for the Pyth

## Libraries

### Python declarations for libraries
Remember: there are very limited cases for libraries (e.g. significant amounts of native code is compiled) so, if in doubt, do not package them.

Libraries built for Python 3 should include `depends_on "[email protected]"`, which will bottle against Homebrew's Python 3.x. Python 2.x libraries must function when they are installed against either the system Python or brewed Python.
### Python declarations for libraries

Python 2 libraries need a `uses_from_macos "python@2"` declaration; they will be built with the system Python, but should still be usable with any other Python 2.7. If not, it's an upstream bug; [here's some advice for resolving it](https://blog.tim-smith.us/2015/09/python-extension-modules-os-x/).
Libraries built for Python 3 should include `depends_on "python@3.x"`, which will bottle against Homebrew's Python 3.x.

### Installing libraries

Expand Down

0 comments on commit ae94d9e

Please sign in to comment.