bump-formula-pr: add message to check resources
This commit is contained in:
parent
227da3aa00
commit
e686a392c5
@ -330,11 +330,22 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
unless args.dry_run?
|
unless args.dry_run?
|
||||||
PyPI.update_python_resources! formula, new_formula_version, silent: args.quiet?, ignore_non_pypi_packages: true
|
resources_checked = PyPI.update_python_resources! formula, new_formula_version,
|
||||||
|
silent: args.quiet?, ignore_non_pypi_packages: true
|
||||||
end
|
end
|
||||||
|
|
||||||
run_audit(formula, alias_rename, old_contents, args: args)
|
run_audit(formula, alias_rename, old_contents, args: args)
|
||||||
|
|
||||||
|
pr_message = "Created with `brew bump-formula-pr`."
|
||||||
|
if resources_checked.nil? && formula.resources.present? &&
|
||||||
|
formula.resources.any? { |resource| resource.name != "homebrew-virtualenv" }
|
||||||
|
pr_message += <<~EOS
|
||||||
|
|
||||||
|
|
||||||
|
`resource` blocks may require updates.
|
||||||
|
EOS
|
||||||
|
end
|
||||||
|
|
||||||
pr_info = {
|
pr_info = {
|
||||||
sourcefile_path: formula.path,
|
sourcefile_path: formula.path,
|
||||||
old_contents: old_contents,
|
old_contents: old_contents,
|
||||||
@ -345,7 +356,7 @@ module Homebrew
|
|||||||
previous_branch: previous_branch,
|
previous_branch: previous_branch,
|
||||||
tap: formula.tap,
|
tap: formula.tap,
|
||||||
tap_full_name: tap_full_name,
|
tap_full_name: tap_full_name,
|
||||||
pr_message: "Created with `brew bump-formula-pr`.",
|
pr_message: pr_message,
|
||||||
}
|
}
|
||||||
GitHub.create_bump_pr(pr_info, args: args)
|
GitHub.create_bump_pr(pr_info, args: args)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -56,6 +56,7 @@ module PyPI
|
|||||||
[json["info"]["name"], sdist["url"], sdist["digests"]["sha256"]]
|
[json["info"]["name"], sdist["url"], sdist["digests"]["sha256"]]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Return true if resources were checked (even if no change)
|
||||||
def update_python_resources!(formula, version = nil, print_only: false, silent: false,
|
def update_python_resources!(formula, version = nil, print_only: false, silent: false,
|
||||||
ignore_non_pypi_packages: false)
|
ignore_non_pypi_packages: false)
|
||||||
|
|
||||||
@ -160,5 +161,7 @@ module PyPI
|
|||||||
end
|
end
|
||||||
s.sub! inreplace_regex, new_resource_blocks
|
s.sub! inreplace_regex, new_resource_blocks
|
||||||
end
|
end
|
||||||
|
|
||||||
|
true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user