Skip to content

Commit 745deb6

Browse files
committed
python-setuptools: build an :all bottle
Let's clean up some hardcoded `/opt/homebrew` and `/usr/local` references so that all our bottles have the same checksums.
1 parent 9a4b084 commit 745deb6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Formula/p/python-setuptools.rb

+14
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,22 @@ def pythons
2424
end
2525

2626
def install
27+
inreplace_paths = %w[
28+
_distutils/unixccompiler.py
29+
_vendor/platformdirs/unix.py
30+
tests/test_easy_install.py
31+
]
32+
2733
pythons.each do |python|
2834
system python, "-m", "pip", "install", *std_pip_args, "."
35+
36+
# Ensure uniform bottles
37+
setuptools_site_packages = prefix/Language::Python.site_packages(python)/"setuptools"
38+
inreplace setuptools_site_packages/"_vendor/platformdirs/macos.py", "/opt/homebrew", HOMEBREW_PREFIX
39+
40+
inreplace_files = inreplace_paths.map { |file| setuptools_site_packages/file }
41+
inreplace_files += setuptools_site_packages.glob("_vendor/platformdirs-*dist-info/METADATA")
42+
inreplace inreplace_files, "/usr/local", HOMEBREW_PREFIX
2943
end
3044
end
3145

0 commit comments

Comments
 (0)