Skip to content

Commit

Permalink
python-setuptools: build an :all bottle
Browse files Browse the repository at this point in the history
Let's clean up some hardcoded `/opt/homebrew` and `/usr/local`
references so that all our bottles have the same checksums.
  • Loading branch information
carlocab committed Sep 20, 2024
1 parent 9a4b084 commit 745deb6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Formula/p/python-setuptools.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,22 @@ def pythons
end

def install
inreplace_paths = %w[
_distutils/unixccompiler.py
_vendor/platformdirs/unix.py
tests/test_easy_install.py
]

pythons.each do |python|
system python, "-m", "pip", "install", *std_pip_args, "."

# Ensure uniform bottles
setuptools_site_packages = prefix/Language::Python.site_packages(python)/"setuptools"
inreplace setuptools_site_packages/"_vendor/platformdirs/macos.py", "/opt/homebrew", HOMEBREW_PREFIX

inreplace_files = inreplace_paths.map { |file| setuptools_site_packages/file }
inreplace_files += setuptools_site_packages.glob("_vendor/platformdirs-*dist-info/METADATA")
inreplace inreplace_files, "/usr/local", HOMEBREW_PREFIX
end
end

Expand Down

0 comments on commit 745deb6

Please sign in to comment.