From c9af8a632d7461cebfaeff8eed7c2bd836e5ae22 Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Sat, 9 Jul 2022 22:22:10 +0800 Subject: [PATCH] language/python: add `--install-lib` to `setup_install_args` About 25 formula in homebrew/core pass `--install-lib` to `python3` in addition to `*setup_install_args` in order to ensure that all files are installed into the formula's prefix rather than into a `site-packages` directory in Python's keg. Let's simplify these formulae by also adding the appropriate `--install-lib` flag to `setup_install_args`. --- Library/Homebrew/language/python.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/language/python.rb b/Library/Homebrew/language/python.rb index 8348523abc..958dbc2487 100644 --- a/Library/Homebrew/language/python.rb +++ b/Library/Homebrew/language/python.rb @@ -70,7 +70,7 @@ module Language quiet_system python, "-c", script end - def self.setup_install_args(prefix) + def self.setup_install_args(prefix, python = "python3") shim = <<~PYTHON import setuptools, tokenize __file__ = 'setup.py' @@ -84,6 +84,7 @@ module Language install --prefix=#{prefix} --install-scripts=#{prefix}/bin + --install-lib=#{prefix/site_packages(python)} --single-version-externally-managed --record=installed.txt ]