diff --git a/Formula/p/python-setuptools.rb b/Formula/p/python-setuptools.rb index 34967cb2c9b9..92ce5caad31c 100644 --- a/Formula/p/python-setuptools.rb +++ b/Formula/p/python-setuptools.rb @@ -6,13 +6,8 @@ class PythonSetuptools < Formula license "MIT" bottle do - sha256 cellar: :any_skip_relocation, arm64_sequoia: "6dc19deb18ad122f26f6201aa5191acfdc95da06bf1b02d1fbd530e7497d5102" - sha256 cellar: :any_skip_relocation, arm64_sonoma: "6dc19deb18ad122f26f6201aa5191acfdc95da06bf1b02d1fbd530e7497d5102" - sha256 cellar: :any_skip_relocation, arm64_ventura: "6dc19deb18ad122f26f6201aa5191acfdc95da06bf1b02d1fbd530e7497d5102" - sha256 cellar: :any_skip_relocation, sequoia: "4a828685a6098a2045e6ea0de9ac03d335f9cde04ec3650c1d3cddb01de59a9b" - sha256 cellar: :any_skip_relocation, sonoma: "4a828685a6098a2045e6ea0de9ac03d335f9cde04ec3650c1d3cddb01de59a9b" - sha256 cellar: :any_skip_relocation, ventura: "4a828685a6098a2045e6ea0de9ac03d335f9cde04ec3650c1d3cddb01de59a9b" - sha256 cellar: :any_skip_relocation, x86_64_linux: "354fb7eb8b83f3a4e8f2ccf215e429d08b0945acf108676cf371b3779a3d59f6" + rebuild 1 + sha256 cellar: :any_skip_relocation, all: "2dc17c4502fb53a5b14bbd65e2c8d1d0fbd62f74f142f2046f146af7731c1335" end depends_on "python@3.12" => [:build, :test] @@ -24,8 +19,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