Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utils/pypi: allow overwriting resource patches #16902

Merged

Conversation

cho-m
Copy link
Member

@cho-m cho-m commented Mar 16, 2024

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

Mainly to prevent autobump from failing whenever we have patched resources. This allows PR to be created and then a maintainer may need to restore patch. Not too different than what we might manually do (i.e. remove patch, brew update-python-resources ..., re-apply patch).

Can consider carrying over patches on identical versions later on.


One example usage is dvc after Homebrew/homebrew-core#166343

Before:

brew update-python-resources dvc
==> Retrieving PyPI dependencies for "dvc[all]==3.48.4"...
==> Retrieving PyPI dependencies for excluded "certifi cryptography numpy"...
==> Getting PyPI info for "adlfs==2024.2.0"
==> Getting PyPI info for "aiobotocore==2.12.1"
...
==> Getting PyPI info for "zc-lockfile==3.0.post1"
==> Updating resource blocks
Error: Unable to update resource blocks for "dvc" automatically. Please update them manually.

After:

brew update-python-resources dvc
==> Retrieving PyPI dependencies for "dvc[all]==3.48.4"...
==> Retrieving PyPI dependencies for excluded "certifi cryptography numpy"...
==> Getting PyPI info for "adlfs==2024.2.0"
==> Getting PyPI info for "aiobotocore==2.12.1"
...
==> Getting PyPI info for "zc-lockfile==3.0.post1"
==> Updating resource blocksgit diff
diff --git a/Formula/d/dvc.rb b/Formula/d/dvc.rb
index 0af6302e9a3..14ec4b11b2e 100644
--- a/Formula/d/dvc.rb
+++ b/Formula/d/dvc.rb
@@ -581,12 +581,6 @@ class Dvc < Formula
   resource "pyarrow" do
     url "https://files.pythonhosted.org/packages/ac/f8/38a8498b294a6d3c74cd81bb411c510d52dfdd40d082651ded761fa7a964/pyarrow-15.0.1.tar.gz"
     sha256 "21d812548d39d490e0c6928a7c663f37b96bf764034123d4b4ab4530ecc757a9"
-
-    # Backport fix for Cython 3.0.9+
-    patch :p2 do
-      url "https://github.com/apache/arrow/commit/1d966e98e41ce817d1f8c5159c0b9caa4de75816.patch?full_index=1"
-      sha256 "3272126cb6726744cfeb770513eb2b8b105b7926a38477a6bbd4aa0352beb6d5"
-    end
   end

   resource "pyasn1" do

Signed-off-by: Michael Cho <michael@michaelcho.dev>
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense thanks @cho-m!

@MikeMcQuaid MikeMcQuaid merged commit 672eb1f into Homebrew:master Mar 18, 2024
26 checks passed
@cho-m cho-m deleted the utils-pypi-allow-overwrite-resource-patches branch March 18, 2024 15:13
@github-actions github-actions bot added the outdated PR was locked due to age label Apr 18, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants