21 Commits

Author SHA1 Message Date
Adrian Ho
7e946c19a2 update-python-resources: work on bare formula
Also favor Homebrew API over manual string comparison.

Resolves https://github.com/orgs/Homebrew/discussions/5967.
2025-02-21 10:32:39 +08:00
Adrian Ho
956b71eeed update-python-resources: add option to ignore errors
This is particularly useful for third-party Python formulae that have a ton of resources, not all of which may adhere to homebrew/core's strict policies. See #19240 for context.

I've also added logic that ignores `--ignore-errors` on `homebrew/core`, although I personally think this new behavior is also useful for mainline formula creation.

Before: error out on a single non-conforming resource, zero resource blocks added to formula, scary stacktrace.

After: all conforming resources added, all non-conforming resources identified in comments, error message at end, `brew` exits non-zero without scary stacktrace:-
```
% brew update-python-resources --ignore-errors gromgit/test/auto-coder || echo OOPS
==> Retrieving PyPI dependencies for "auto-coder==0.1.243"...
==> Retrieving PyPI dependencies for excluded ""...
==> Getting PyPI info for "aiohappyeyeballs==2.4.4"
[200+ resource lines elided]
==> Getting PyPI info for "zhipuai==2.1.5.20250106"
==> Updating resource blocks
Error: Unable to resolve some dependencies. Please check /opt/homebrew/Library/Taps/gromgit/homebrew-test/Formula/auto-coder.rb for RESOURCE-ERROR comments.
OOPS

% brew cat gromgit/test/auto-coder | ggrep -C10 RESOURCE-ERROR
  license "Apache-2.0"

  depends_on "python@3.11"

  # Additional dependency
  # resource "" do
  #   url ""
  #   sha256 ""
  # end

  # RESOURCE-ERROR: Unable to resolve "azure-cognitiveservices-speech==1.42.0" (no suitable source distribution on PyPI)
  # RESOURCE-ERROR: Unable to resolve "ray==2.42.0" (no suitable source distribution on PyPI)

  resource "aiohappyeyeballs" do
    url "e4373e888f/aiohappyeyeballs-2.4.4.tar.gz"
    sha256 "5fdd7d87889c63183afc18ce9271f9b0a7d32c2303e394468dd45d514a757745"
  end

  resource "aiohttp" do
    url "952d49c730/aiohttp-3.11.12.tar.gz"
    sha256 "7603ca26d75b1b86160ce1bbe2787a0b706e592af5b2504e12caa88a217767b0"
  end
```
2025-02-06 21:20:55 +08:00
Douglas Eichelberger
c50fb2dbd2 Remove redundant cli/parser requires 2024-03-29 18:53:07 -07:00
Douglas Eichelberger
7bef4b010c Port Homebrew::DevCmd::UpdatePythonResources 2024-03-22 09:33:28 -07:00
Michael Cho
216f571fff
bump-formula-pr: switch to install resource update dependencies
Also same feature for update-python-resources
2024-03-02 22:01:31 -05:00
Michael Cho
10659a1d61
update-python-resources: show pip install failure when --verbose
Also use `--disable-pip-version-check` to remove pip update notices
2023-12-30 12:16:09 -05:00
Bo Anderson
bb7aef85db
Migrate remaining no-api commands to new scoped system 2023-06-22 17:11:20 +01:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
EricFromCanada
dfc9906184
internal messaging fixes 2023-02-10 23:17:16 -05:00
Mike McQuaid
2d5eab2e1c
brew style --fix 2022-06-30 08:56:21 +01:00
Rylan Polster
d1f3e39b7b
Update commands to generate usage banner 2021-01-18 21:20:11 -05:00
Dawid Dziurla
cf654da251
dev-cmd: indicate multiple named args in usage banner 2021-01-15 13:04:07 +01:00
Rylan Polster
da811373d3 Add named_args DSL for commands 2021-01-13 17:09:42 -05:00
Markus Reiter
5be4c9b5e0 Upgrade typed sigils. 2020-11-25 17:04:19 +01:00
Rylan Polster
51a1b7c9e1 move pypi list to tap formula_lists directory 2020-11-24 15:40:15 -05:00
Rylan Polster
8e670995f8 migrate automatic python resource list to Homebrew/core 2020-11-24 15:40:15 -05:00
EricFromCanada
72bc057014 manpage: fixes for formatting 2020-11-16 08:02:50 -05:00
Markus Reiter
da9289eff0 Add more type signatures. 2020-11-13 12:26:36 +01:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
William Ma
fa7bd3bff6 args: Migrate usage of args loading methods to args.named 2020-08-23 09:02:20 -04:00
Rylan Polster
2d086013f9 dev-cmd: add update-python-resources command 2020-07-29 09:50:16 -04:00