Skip to content

Commit

Permalink
Merge pull request #16888 from cho-m/formula-no-python2.7-dir
Browse files Browse the repository at this point in the history
formula: remove setting up home for python 2.7
  • Loading branch information
MikeMcQuaid authored Mar 14, 2024
2 parents 697d416 + cc82c52 commit a7d7748
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions Library/Homebrew/formula.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2669,15 +2669,8 @@ def inreplace(paths, before = nil, after = nil, audit_result = true, &block) # r

protected

sig { params(home: Pathname).void }
def setup_home(home)
# keep Homebrew's site-packages in sys.path when using system Python
user_site_packages = home/"Library/Python/2.7/lib/python/site-packages"
user_site_packages.mkpath
(user_site_packages/"homebrew.pth").write <<~PYTHON
import site; site.addsitedir("#{HOMEBREW_PREFIX}/lib/python2.7/site-packages")
import sys, os; sys.path = (os.environ["PYTHONPATH"].split(os.pathsep) if "PYTHONPATH" in os.environ else []) + ["#{HOMEBREW_PREFIX}/lib/python2.7/site-packages"] + sys.path
PYTHON

# Don't let bazel write to tmp directories we don't control or clean.
(home/".bazelrc").write "startup --output_user_root=#{home}/_bazel"
end
Expand Down

0 comments on commit a7d7748

Please sign in to comment.