From 3d36b23a75800fd26aa16935cdd70630487c079f Mon Sep 17 00:00:00 2001 From: Michael Cho Date: Fri, 1 Nov 2024 21:23:53 -0400 Subject: [PATCH 1/3] pycparser: drop `python@3.11` support --- Formula/p/pycparser.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/Formula/p/pycparser.rb b/Formula/p/pycparser.rb index 668edbf462c8..cdfcb199123d 100644 --- a/Formula/p/pycparser.rb +++ b/Formula/p/pycparser.rb @@ -10,7 +10,6 @@ class Pycparser < Formula sha256 cellar: :any_skip_relocation, all: "96eddd22a812be4f919562d6525ab8fa19b03b700426d2fbf892da0f4fd02e73" end - depends_on "python@3.11" => [:build, :test] depends_on "python@3.12" => [:build, :test] depends_on "python@3.13" => [:build, :test] From bb2893f34e877b72b4512838296fb7233e9bd096 Mon Sep 17 00:00:00 2001 From: Michael Cho Date: Fri, 1 Nov 2024 21:24:10 -0400 Subject: [PATCH 2/3] cffi: drop `python@3.11` support --- Formula/c/cffi.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/Formula/c/cffi.rb b/Formula/c/cffi.rb index 0890b19131cf..e23130e11ea5 100644 --- a/Formula/c/cffi.rb +++ b/Formula/c/cffi.rb @@ -15,7 +15,6 @@ class Cffi < Formula sha256 cellar: :any_skip_relocation, x86_64_linux: "a49b146e624fa887497252f89c76d8e7cfcdc4d9a4ec444a5b8db856324198cf" end - depends_on "python@3.11" => [:build, :test] depends_on "python@3.12" => [:build, :test] depends_on "python@3.13" => [:build, :test] depends_on "pycparser" From d7e86581600d2e9f1a87de1db0ca0749170a003f Mon Sep 17 00:00:00 2001 From: Michael Cho Date: Fri, 1 Nov 2024 21:25:15 -0400 Subject: [PATCH 3/3] cryptography: drop `python@3.11` support --- Formula/c/cryptography.rb | 42 ++++---------------------------------- pypi_formula_mappings.json | 3 +-- 2 files changed, 5 insertions(+), 40 deletions(-) diff --git a/Formula/c/cryptography.rb b/Formula/c/cryptography.rb index 6f91b5f846f1..087895b8fa8b 100644 --- a/Formula/c/cryptography.rb +++ b/Formula/c/cryptography.rb @@ -17,33 +17,13 @@ class Cryptography < Formula depends_on "maturin" => :build depends_on "pkg-config" => :build - depends_on "python@3.11" => [:build, :test] + depends_on "python-setuptools" => :build depends_on "python@3.12" => [:build, :test] depends_on "python@3.13" => [:build, :test] depends_on "rust" => :build depends_on "cffi" depends_on "openssl@3" - resource "maturin" do - url "https://files.pythonhosted.org/packages/51/28/31a650d9209d873b6aec759c944bd284155154d7a01f7f541786d7c435ca/maturin-1.7.4.tar.gz" - sha256 "2b349d742a07527d236f0b4b6cab26f53ebecad0ceabfc09ec4c6a396e3176f9" - end - - resource "semantic-version" do - url "https://files.pythonhosted.org/packages/7d/31/f2289ce78b9b473d582568c234e104d2a342fd658cc288a7553d83bb8595/semantic_version-2.10.0.tar.gz" - sha256 "bdabb6d336998cbb378d4b9db3a4b56a1e3235701dc05ea2690d9a997ed5041c" - end - - resource "setuptools" do - url "https://files.pythonhosted.org/packages/07/37/b31be7e4b9f13b59cde9dcaeff112d401d49e0dc5b37ed4a9fc8fb12f409/setuptools-75.2.0.tar.gz" - sha256 "753bb6ebf1f465a1912e19ed1d41f403a79173a9acf66a42e7e6aec45c3c16ec" - end - - resource "setuptools-rust" do - url "https://files.pythonhosted.org/packages/d3/6b/99a1588d826ceb108694ba00f78bc6afda10ed5d72d550ae8f256af1f7b4/setuptools_rust-1.10.2.tar.gz" - sha256 "5d73e7eee5f87a6417285b617c97088a7c20d1a70fcea60e3bdc94ff567c29dc" - end - def pythons deps.map(&:to_formula) .select { |f| f.name.start_with?("python@") } @@ -51,34 +31,20 @@ def pythons end def install - ENV.append_path "PATH", buildpath/"bin" - # Resources need to be installed in a particular order, so we can't use `resources.each`. - resources_in_install_order = %w[setuptools setuptools-rust semantic-version] - + # TODO: Avoid building multiple times as binaries are already built in limited API mode pythons.each do |python3| - buildpath_site_packages = buildpath/Language::Python.site_packages(python3) - ENV.append_path "PYTHONPATH", buildpath_site_packages - - resources_in_install_order.each do |r| - resource(r).stage do - system python3, "-m", "pip", "install", *std_pip_args(prefix: buildpath), "." - end - end - system python3, "-m", "pip", "install", *std_pip_args, "." - - ENV.remove "PYTHONPATH", buildpath_site_packages end end test do - (testpath/"test.py").write <<~EOS + (testpath/"test.py").write <<~PYTHON from cryptography.fernet import Fernet key = Fernet.generate_key() f = Fernet(key) token = f.encrypt(b"homebrew") print(f.decrypt(token)) - EOS + PYTHON pythons.each do |python3| assert_match "b'homebrew'", shell_output("#{python3} test.py") diff --git a/pypi_formula_mappings.json b/pypi_formula_mappings.json index f2c247718877..08071963d10d 100644 --- a/pypi_formula_mappings.json +++ b/pypi_formula_mappings.json @@ -219,8 +219,7 @@ "exclude_packages": ["certifi"] }, "cryptography": { - "exclude_packages": ["cffi", "pycparser"], - "extra_packages": ["maturin", "setuptools-rust"] + "exclude_packages": ["cffi", "pycparser"] }, "cycode": { "exclude_packages": ["certifi"]