Skip to content

Commit 25f1eb6

Browse files
authored
Merge pull request #191316 from Homebrew/python-setuptools-all
python-setuptools: build an `:all` bottle
2 parents 176c3fe + c79c12d commit 25f1eb6

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

Formula/p/python-setuptools.rb

+16-7
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,8 @@ class PythonSetuptools < Formula
66
license "MIT"
77

88
bottle do
9-
sha256 cellar: :any_skip_relocation, arm64_sequoia: "6dc19deb18ad122f26f6201aa5191acfdc95da06bf1b02d1fbd530e7497d5102"
10-
sha256 cellar: :any_skip_relocation, arm64_sonoma: "6dc19deb18ad122f26f6201aa5191acfdc95da06bf1b02d1fbd530e7497d5102"
11-
sha256 cellar: :any_skip_relocation, arm64_ventura: "6dc19deb18ad122f26f6201aa5191acfdc95da06bf1b02d1fbd530e7497d5102"
12-
sha256 cellar: :any_skip_relocation, sequoia: "4a828685a6098a2045e6ea0de9ac03d335f9cde04ec3650c1d3cddb01de59a9b"
13-
sha256 cellar: :any_skip_relocation, sonoma: "4a828685a6098a2045e6ea0de9ac03d335f9cde04ec3650c1d3cddb01de59a9b"
14-
sha256 cellar: :any_skip_relocation, ventura: "4a828685a6098a2045e6ea0de9ac03d335f9cde04ec3650c1d3cddb01de59a9b"
15-
sha256 cellar: :any_skip_relocation, x86_64_linux: "354fb7eb8b83f3a4e8f2ccf215e429d08b0945acf108676cf371b3779a3d59f6"
9+
rebuild 1
10+
sha256 cellar: :any_skip_relocation, all: "2dc17c4502fb53a5b14bbd65e2c8d1d0fbd62f74f142f2046f146af7731c1335"
1611
end
1712

1813
depends_on "[email protected]" => [:build, :test]
@@ -24,8 +19,22 @@ def pythons
2419
end
2520

2621
def install
22+
inreplace_paths = %w[
23+
_distutils/unixccompiler.py
24+
_vendor/platformdirs/unix.py
25+
tests/test_easy_install.py
26+
]
27+
2728
pythons.each do |python|
2829
system python, "-m", "pip", "install", *std_pip_args, "."
30+
31+
# Ensure uniform bottles
32+
setuptools_site_packages = prefix/Language::Python.site_packages(python)/"setuptools"
33+
inreplace setuptools_site_packages/"_vendor/platformdirs/macos.py", "/opt/homebrew", HOMEBREW_PREFIX
34+
35+
inreplace_files = inreplace_paths.map { |file| setuptools_site_packages/file }
36+
inreplace_files += setuptools_site_packages.glob("_vendor/platformdirs-*dist-info/METADATA")
37+
inreplace inreplace_files, "/usr/local", HOMEBREW_PREFIX
2938
end
3039
end
3140

0 commit comments

Comments
 (0)