Skip to content

Commit

Permalink
language/python: add --install-lib to setup_install_args
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
carlocab committed Jul 9, 2022
1 parent 8dd96ae commit c9af8a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Library/Homebrew/language/python.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def self.in_sys_path?(python, path)
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'
Expand All @@ -84,6 +84,7 @@ def self.setup_install_args(prefix)
install
--prefix=#{prefix}
--install-scripts=#{prefix}/bin
--install-lib=#{prefix/site_packages(python)}
--single-version-externally-managed
--record=installed.txt
]
Expand Down

0 comments on commit c9af8a6

Please sign in to comment.