Port Homebrew::DevCmd::UpdatePythonResources
This commit is contained in:
parent
46d758d5cf
commit
7bef4b010c
@ -1,28 +1,27 @@
|
||||
# typed: true
|
||||
# typed: strict
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "abstract_command"
|
||||
require "cli/parser"
|
||||
require "utils/github"
|
||||
require "manpages"
|
||||
require "system_command"
|
||||
|
||||
module Homebrew
|
||||
extend SystemCommand::Mixin
|
||||
module DevCmd
|
||||
class UpdateMaintainers < AbstractCommand
|
||||
include SystemCommand::Mixin
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
def self.update_maintainers_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
cmd_args do
|
||||
description <<~EOS
|
||||
Update the list of maintainers in the `Homebrew/brew` README.
|
||||
EOS
|
||||
|
||||
named_args :none
|
||||
end
|
||||
end
|
||||
|
||||
def self.update_maintainers
|
||||
update_maintainers_args.parse
|
||||
|
||||
sig { override.void }
|
||||
def run
|
||||
# We assume that only public members wish to be included in the README
|
||||
public_members = GitHub.public_member_usernames("Homebrew")
|
||||
maintainers = GitHub.members_by_team("Homebrew", "maintainers")
|
||||
@ -65,4 +64,6 @@ module Homebrew
|
||||
puts "List of maintainers updated in the README and the generated man pages."
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -1,15 +1,14 @@
|
||||
# typed: true
|
||||
# typed: strict
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "abstract_command"
|
||||
require "cli/parser"
|
||||
require "utils/pypi"
|
||||
|
||||
module Homebrew
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
def update_python_resources_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
module DevCmd
|
||||
class UpdatePythonResources < AbstractCommand
|
||||
cmd_args do
|
||||
description <<~EOS
|
||||
Update versions for PyPI resource blocks in <formula>.
|
||||
EOS
|
||||
@ -34,11 +33,9 @@ module Homebrew
|
||||
|
||||
named_args :formula, min: 1, without_api: true
|
||||
end
|
||||
end
|
||||
|
||||
def update_python_resources
|
||||
args = update_python_resources_args.parse
|
||||
|
||||
sig { override.void }
|
||||
def run
|
||||
args.named.to_formulae.each do |formula|
|
||||
PyPI.update_python_resources! formula,
|
||||
version: args.version,
|
||||
@ -52,4 +49,6 @@ module Homebrew
|
||||
ignore_non_pypi_packages: args.ignore_non_pypi_packages?
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "cmd/shared_examples/args_parse"
|
||||
require "dev-cmd/update-maintainers"
|
||||
|
||||
RSpec.describe "brew update-maintainers" do
|
||||
RSpec.describe Homebrew::DevCmd::UpdateMaintainers do
|
||||
it_behaves_like "parseable arguments"
|
||||
end
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "cmd/shared_examples/args_parse"
|
||||
require "dev-cmd/update-python-resources"
|
||||
|
||||
RSpec.describe "brew update-python-resources" do
|
||||
RSpec.describe Homebrew::DevCmd::UpdatePythonResources do
|
||||
it_behaves_like "parseable arguments"
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user