diff --git a/docs/homebrew.md b/docs/homebrew.md index b3a72ca..4397de7 100644 --- a/docs/homebrew.md +++ b/docs/homebrew.md @@ -60,5 +60,5 @@ brew update-python-resources Formula/roll.rb ## Notes for `roll` - `rl update` intentionally does not self-update. Homebrew users should use `brew upgrade roll`. -- package versioning is configured to work from git archives used by tagged source tarballs. +- the formula exports `SETUPTOOLS_SCM_PRETEND_VERSION_FOR_ROLL`, so Homebrew does not depend on git metadata surviving the GitHub archive step. - a meaningful `brew test` should initialize a temporary archive and verify that `.roll` was created. diff --git a/packaging/homebrew/roll.rb b/packaging/homebrew/roll.rb index 919050e..df8438f 100644 --- a/packaging/homebrew/roll.rb +++ b/packaging/homebrew/roll.rb @@ -20,6 +20,9 @@ class Roll < Formula end def install + # GitHub source archives do not reliably preserve enough VCS metadata for + # setuptools-scm, so pin the package version from the formula itself. + ENV["SETUPTOOLS_SCM_PRETEND_VERSION_FOR_ROLL"] = version.to_s virtualenv_install_with_resources end