Class: Homebrew::DevCmd::BumpPythonResourcesPr Private

Inherits:
AbstractCommand show all
Defined in:
dev-cmd/bump-python-resources-pr.rb,
sorbet/rbi/dsl/homebrew/dev_cmd/bump_python_resources_pr.rbi

This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.

Defined Under Namespace

Classes: Args

Constant Summary collapse

Result =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

T.type_alias { T::Hash[Symbol, T.any(String, T::Boolean)] }

Instance Method Summary collapse

Methods inherited from AbstractCommand

command, command_name, dev_cmd?, #initialize, parser, ruby_cmd?

Methods included from Utils::Output::Mixin

#issue_reporting_message, #odebug, #odeprecated, #odie, #odisabled, #ofail, #oh1, #oh1_title, #ohai, #ohai_title, #onoe, #opoo, #opoo_outside_github_actions, #opoo_without_github_actions_annotation, #pretty_deprecated, #pretty_disabled, #pretty_duration, #pretty_install_status, #pretty_installed, #pretty_uninstalled, #pretty_unmarked, #pretty_upgradable, #pretty_warning

Constructor Details

This class inherits a constructor from Homebrew::AbstractCommand

Instance Method Details

#argsHomebrew::DevCmd::BumpPythonResourcesPr::Args

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.



10
# File 'sorbet/rbi/dsl/homebrew/dev_cmd/bump_python_resources_pr.rbi', line 10

def args; end

#runvoid

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Raises:



41
42
43
44
45
46
47
48
49
50
51
52
# File 'dev-cmd/bump-python-resources-pr.rb', line 41

def run
  raise UsageError, "`--packages` must name at least one vulnerable Python package." if args.packages.blank?

  Utils::GemSetup.install_bundler_gems!(groups: ["ast"])
  require "utils/ast"
  require "utils/pypi"

  packages = args.packages.to_a.map { |package| PyPI.normalize_python_package(package) }.uniq

  formula = args.named.to_formulae.fetch(0)
  write_result(bump_resources(formula, packages))
end