From ee55f8396f8e783f87e16453188b7d191d0df5cc Mon Sep 17 00:00:00 2001 From: Branch Vincent Date: Tue, 5 Oct 2021 01:37:42 -0400 Subject: [PATCH] python@3.10: make keg-only --- Formula/python@3.10.rb | 27 ++++--------------- .../versioned_keg_only_allowlist.json | 1 - 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/Formula/python@3.10.rb b/Formula/python@3.10.rb index 385e948ac922..a21d8c256b0a 100644 --- a/Formula/python@3.10.rb +++ b/Formula/python@3.10.rb @@ -5,6 +5,7 @@ class PythonAT310 < Formula url "https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tgz" sha256 "c4e0cbad57c90690cb813fb4663ef670b4d0f587d8171e2c42bd4c9245bd2758" license "Python-2.0" + revision 1 livecheck do url "https://www.python.org/ftp/python/" @@ -23,6 +24,8 @@ class PythonAT310 < Formula # build packages later. Xcode-only systems need different flags. pour_bottle? only_if: :clt_installed + keg_only :versioned_formula + depends_on "pkg-config" => :build depends_on "gdbm" depends_on "mpdecimal" @@ -42,21 +45,6 @@ class PythonAT310 < Formula skip_clean "bin/easy_install3", "bin/easy_install-3.4", "bin/easy_install-3.5", "bin/easy_install-3.6", "bin/easy_install-3.7", "bin/easy_install-3.8", "bin/easy_install-3.9" - link_overwrite "bin/2to3" - link_overwrite "bin/idle3" - link_overwrite "bin/pip3" - link_overwrite "bin/pydoc3" - link_overwrite "bin/python3" - link_overwrite "bin/python3-config" - link_overwrite "bin/wheel3" - link_overwrite "share/man/man1/python3.1" - link_overwrite "lib/pkgconfig/python3.pc" - link_overwrite "lib/pkgconfig/python3-embed.pc" - link_overwrite "Frameworks/Python.framework/Headers" - link_overwrite "Frameworks/Python.framework/Python" - link_overwrite "Frameworks/Python.framework/Resources" - link_overwrite "Frameworks/Python.framework/Versions/Current" - resource "setuptools" do url "https://files.pythonhosted.org/packages/1e/5c/3d7b3d91a86d71faf5038c5d259ed36b5d05b7804648e2c43251d574a6e6/setuptools-58.2.0.tar.gz" sha256 "2c55bdb85d5bb460bd2e3b12052b677879cffcf46c0c688f2e5bf51d36001145" @@ -347,11 +335,6 @@ def post_install (libexec/"bin").install_symlink (bin/versioned_name).realpath => unversioned_name end - # post_install happens after link - %W[pip3 wheel3 pip#{version.major_minor}].each do |e| - (HOMEBREW_PREFIX/"bin").install_symlink bin/e - end - # Help distutils find brewed stuff when building extensions include_dirs = [HOMEBREW_PREFIX/"include", Formula["openssl@1.1"].opt_include, Formula["sqlite"].opt_include] @@ -424,14 +407,14 @@ def sitecustomize def caveats <<~EOS Python has been installed as - #{HOMEBREW_PREFIX}/bin/python3 + #{opt_bin}/python3 Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to `python3`, `python3-config`, `pip3` etc., respectively, have been installed into #{opt_libexec}/bin You can install Python packages with - pip3 install + #{opt_bin}/pip3 install They will install into the site-package directory #{HOMEBREW_PREFIX/"lib/python#{version.major_minor}/site-packages"} diff --git a/audit_exceptions/versioned_keg_only_allowlist.json b/audit_exceptions/versioned_keg_only_allowlist.json index 75e665f933c9..62e2d3d9aaec 100644 --- a/audit_exceptions/versioned_keg_only_allowlist.json +++ b/audit_exceptions/versioned_keg_only_allowlist.json @@ -24,7 +24,6 @@ "pangomm@2.46", "pyqt@5", "python@3.9", - "python@3.10", "python-tk@3.9", "python-tk@3.10", "wxwidgets@3.0"