Merge pull request #8493 from reitermarkus/document-pypi

Document `PyPi`.
This commit is contained in:
Markus Reiter 2020-08-26 10:51:02 +02:00 committed by GitHub
commit 1359f2e323
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -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'

View File

@ -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"