Skip to content

fix: recognize Homebrew Cellar framework prefixes - #612

Merged
gaborbernat merged 5 commits into
tox-dev:mainfrom
sricharanreddycheruku:agent2-homebrew-cellar-prefix
Oct 8, 2026
Merged

gaborbernat merged 5 commits into
tox-dev:mainfrom
sricharanreddycheruku:agent2-homebrew-cellar-prefix

Conversation

@sricharanreddycheruku

Copy link
Copy Markdown
Contributor

Homebrew's Python -S keeps a Cellar framework prefix because sitecustomize is skipped. The opt-only matcher then returns system shared directories. Recognize both layouts and extend the existing directory tests.

Source: https://github.com/Homebrew/homebrew-core/blob/48016074c89f8891bba84e868d156000cebd613d/Formula/p/[email protected]#L511

Validation on Linux: before, 48 Cellar cases failed and 48 opt controls passed; after, 403 macOS-module tests passed with patched prefixes. Tox Python 3.10/3.12/3.13/3.14: each 2061 passed, 125 skipped; final fixture refactor rechecked on 3.12. Changed-line coverage 100%; docs, types, package, hooks and news checks passed. Native macOS was not run.

Includes a news fragment; its filename will be updated to the PR number.

Keep the comment on why the matcher reads sys.base_prefix, and name
both cases that leave the Cellar keg path, -S and PYTHONHOME, as
checked against Homebrew's [email protected], 3.13 and 3.14 sitecustomize.
Number the changelog fragment and link its API references.

@gaborbernat gaborbernat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gaborbernat
gaborbernat enabled auto-merge (squash) October 8, 2026 05:50
The python-freethreading formula builds PythonT.framework instead of
Python.framework, so neither its opt link nor its Cellar keg matched and
macOS site directories skipped the Homebrew prefix for it.
Homebrew names each keg directory by its version and its sitecustomize
recognizes it with [0-9._abrc]+, and no Python formula declares a head
build. Use the same charset so a non-Homebrew path such as
Cellar/python/latest no longer counts as Homebrew.
@gaborbernat
gaborbernat force-pushed the agent2-homebrew-cellar-prefix branch from b8e2611 to 80c33c7 Compare October 8, 2026 07:14
@gaborbernat
gaborbernat merged commit d7eb4fe into tox-dev:main Oct 8, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants