From 6a3b9149e0d484c35af49ff2f5a39d605692da4e Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Wed, 26 Aug 2020 09:39:51 +0200 Subject: [PATCH] Document `PyPi`. --- Library/Homebrew/.rubocop_todo.yml | 1 - Library/Homebrew/utils/pypi.rb | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/.rubocop_todo.yml b/Library/Homebrew/.rubocop_todo.yml index a74f62002a..adca8512f3 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/spdx.rb' diff --git a/Library/Homebrew/utils/pypi.rb b/Library/Homebrew/utils/pypi.rb index 187b92e1b4..e98690b7a9 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"