Skip to content

Commit

Permalink
poetry: don't hardcode Homebrew Python
Browse files Browse the repository at this point in the history
Poetry users may wish to use it with a different version of Python, but
that doesn't work if the path to Homebrew Python is hardcoded in the
shebang.

Fixes #62910.

Closes #70422.

Signed-off-by: Sean Molenaar <[email protected]>
Signed-off-by: BrewTestBot <[email protected]>
  • Loading branch information
carlocab authored and BrewTestBot committed Feb 11, 2021
1 parent 5242467 commit c9b23e8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Formula/poetry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class Poetry < Formula
url "https://files.pythonhosted.org/packages/94/89/92040eafbb76dcbb2b3ee185499b89281f712b34faa7673850778b0ddda4/poetry-1.1.4.tar.gz"
sha256 "946a5a1173be607c7c5c593358a0fb0c0d6af4400c978929ecdb19c3a37b53a8"
license "MIT"
revision 1

bottle do
rebuild 1
Expand Down Expand Up @@ -188,8 +189,10 @@ def install
ENV.prepend_create_path "PYTHONPATH", site_packages
system Formula["[email protected]"].opt_bin/"python3", *Language::Python.setup_install_args(libexec)

# We don't hardcode Homebrew Python here on purpose. See
# https://github.com/Homebrew/homebrew-core/issues/62910
(bin/"poetry").write <<~PYTHON
#!#{Formula["[email protected]"].opt_bin/"python3"}
#!/usr/bin/env python3
import sys
sys.path.insert(0, "#{site_packages}")
Expand Down

0 comments on commit c9b23e8

Please sign in to comment.