From 859dbb074c64ed71bf8ceb144faa1ed05a2249ce Mon Sep 17 00:00:00 2001 From: Branch Vincent Date: Fri, 22 Aug 2025 21:16:24 -0700 Subject: [PATCH] Deprecate `Language::Python.setup_install_args` This method predates Python's standardized `pyproject.toml` build system, introduced in PEP 517 to allow for more build backends than just `setuptools`: https://peps.python.org/pep-0517/. Directly executing `setup.py` has since been deprecated in favor of using PEP 517 compliant installers, such as `pip`: https://packaging.python.org/en/latest/discussions/setup-py-deprecated/ In homebrew/core, our last remaining use is a single disabled formula. For third party taps, simply migrate to `std_pip_args`: ```ruby # Old system python3, *Language::Python.setup_install_args(libexec, python3) # New system python3, "-m", "pip", "install", *std_pip_args, "." ``` --- Library/Homebrew/language/python.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Library/Homebrew/language/python.rb b/Library/Homebrew/language/python.rb index 6bd996d498..87f1f41ee0 100644 --- a/Library/Homebrew/language/python.rb +++ b/Library/Homebrew/language/python.rb @@ -1,11 +1,15 @@ # typed: strict # frozen_string_literal: true +require "utils/output" + module Language # Helper functions for Python formulae. # # @api public module Python + extend ::Utils::Output::Mixin + sig { params(python: T.any(String, Pathname)).returns(T.nilable(Version)) } def self.major_minor_version(python) version = `#{python} --version 2>&1`.chomp[/(\d\.\d+)/, 1] @@ -84,6 +88,7 @@ module Language sig { params(prefix: Pathname, python: T.any(String, Pathname)).returns(T::Array[String]) } def self.setup_install_args(prefix, python = "python3") + # odeprecated "Language::Python.setup_install_args", "pip and `std_pip_args`" shim = <<~PYTHON import setuptools, tokenize __file__ = 'setup.py'