Skip to content

python@3.13: fix sitecustomize.py on linux#246415

Merged
BrewTestBot merged 2 commits intomainfrom
sitecustomize
Oct 3, 2025
Merged

python@3.13: fix sitecustomize.py on linux#246415
BrewTestBot merged 2 commits intomainfrom
sitecustomize

Conversation

@branchv
Copy link
Member

@branchv branchv commented Oct 1, 2025

  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

This fixes #192626 (comment), which was noticed when adding python 3.13 last year and now again with 3.14 in #245931

Our sitecustomize.py on Linux is not replacing Cellar paths with their opt equivalent:

Before (note no change to sys.prefix nor sys.base_prefix):

# Without sitecustomize.py
$ python3 -Sc 'import sys; print(f"{sys.executable=}\n{sys.prefix=}\n{sys.base_prefix=}")'
sys.executable='/home/linuxbrew/.linuxbrew/bin/python3'
sys.prefix='/home/linuxbrew/.linuxbrew/Cellar/python@3.13/3.13.7'
sys.base_prefix='/home/linuxbrew/.linuxbrew/Cellar/python@3.13/3.13.7'

# With sitecustomize.py
$ python3 -c 'import sys; print(f"{sys.executable=}\n{sys.prefix=}\n{sys.base_prefix=}")'
sys.executable='/home/linuxbrew/.linuxbrew/opt/python@3.13/bin/python3.13'
sys.prefix='/home/linuxbrew/.linuxbrew/Cellar/python@3.13/3.13.7'
sys.base_prefix='/home/linuxbrew/.linuxbrew/Cellar/python@3.13/3.13.7'

After:

$ python3 -c 'import sys; print(f"{sys.executable=}\n{sys.prefix=}\n{sys.base_prefix=}")'
sys.executable='/home/linuxbrew/.linuxbrew/opt/python@3.13/bin/python3.13'
sys.prefix='/home/linuxbrew/.linuxbrew/opt/python@3.13'
sys.base_prefix='/home/linuxbrew/.linuxbrew/opt/python@3.13'

Looks like @cho-m had already discovered this in #102295 but went stale

@github-actions github-actions bot added CI-linux-self-hosted-deps Test dependents on Linux self-hosted runner long dependent tests Set a long timeout for dependent testing labels Oct 1, 2025
@branchv branchv added the CI-no-fail-fast-deps Continue dependent tests despite failing GitHub Actions matrix tests. label Oct 1, 2025
@branchv branchv marked this pull request as ready for review October 1, 2025 06:20
@branchv branchv requested review from Bo98 and cho-m October 1, 2025 06:21
@branchv
Copy link
Member Author

branchv commented Oct 2, 2025

All failures are unrelated

  • Linux: streamlink already fixed with streamlink: fix test on linux #246141
  • 14: jrnl Expected password confirmation input
  • 15: flakes (locust, mlx-lm, restview, all local servers too slow to startup)
  • 26: Had to cancel, was hung on brew fetch --retry z3 lz4 zstd llvm lit

@branchv branchv added the ready to merge PR can be merged once CI is green label Oct 2, 2025
@branchv branchv requested a review from a team October 3, 2025 00:50
@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2025

:shipit: @branchvincent has requested bottles to be published to this PR.

Caution

Please do not push to this PR branch before the bottle commits have been pushed, as this results in a state that is difficult to recover from. If you need to resolve a merge conflict, please use a merge commit. Do not force-push to this PR branch.

@github-actions github-actions bot added the CI-published-bottle-commits The commits for the built bottles have been pushed to the PR branch. label Oct 3, 2025
@BrewTestBot BrewTestBot enabled auto-merge October 3, 2025 01:32
@BrewTestBot BrewTestBot added this pull request to the merge queue Oct 3, 2025
Merged via the queue into main with commit 292a595 Oct 3, 2025
22 checks passed
@BrewTestBot BrewTestBot deleted the sitecustomize branch October 3, 2025 01:47
@Homebrew Homebrew deleted a comment from github-actions bot Oct 3, 2025
@Homebrew Homebrew deleted a comment from github-actions bot Oct 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI-linux-self-hosted-deps Test dependents on Linux self-hosted runner CI-no-fail-fast-deps Continue dependent tests despite failing GitHub Actions matrix tests. CI-published-bottle-commits The commits for the built bottles have been pushed to the PR branch. long dependent tests Set a long timeout for dependent testing ready to merge PR can be merged once CI is green

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants