diff --git a/Library/Homebrew/.rubocop_todo.yml b/Library/Homebrew/.rubocop_todo.yml index 2ef059c8f78653456a87f430e0456561e037d37c..8029d48cffe1907ce94746060ba0aefeeb8a471f 100644 --- a/Library/Homebrew/.rubocop_todo.yml +++ b/Library/Homebrew/.rubocop_todo.yml @@ -22,7 +22,6 @@ Style/Documentation: - 'utils/gems.rb' - 'utils/notability.rb' - 'utils/popen.rb' - - 'utils/pypi.rb' - 'utils/shebang.rb' - 'utils/shell.rb' - 'utils/livecheck_formula.rb' diff --git a/Library/Homebrew/utils/pypi.rb b/Library/Homebrew/utils/pypi.rb index 187b92e1b4e7261e7b33f506e80bcc9bfabe7c54..e98690b7a9dbf9b529073e2c65db564e6a4e2713 100644 --- a/Library/Homebrew/utils/pypi.rb +++ b/Library/Homebrew/utils/pypi.rb @@ -1,9 +1,13 @@ # frozen_string_literal: true +# Helper functions for updating PyPi resources. +# +# @api private module PyPI module_function PYTHONHOSTED_URL_PREFIX = "https://files.pythonhosted.org/packages/" + private_constant :PYTHONHOSTED_URL_PREFIX AUTOMATIC_RESOURCE_UPDATE_BLOCKLIST = %w[ ansible @@ -17,6 +21,7 @@ module PyPI salt xonsh ].freeze + private_constant :AUTOMATIC_RESOURCE_UPDATE_BLOCKLIST @pipgrip_installed = nil @@ -34,7 +39,7 @@ module PyPI url end - # Get name, url and sha256 for a given pypi package + # Get name, URL and SHA-256 checksum for a given PyPi package. def get_pypi_info(package, version) metadata_url = "https://pypi.org/pypi/#{package}/#{version}/json" out, _, status = curl_output metadata_url, "--location"