Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document PyPi. #8493

Merged
merged 1 commit into from Aug 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion Library/Homebrew/.rubocop_todo.yml
Expand Up @@ -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'
Expand Down
7 changes: 6 additions & 1 deletion 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
Expand All @@ -17,6 +21,7 @@ module PyPI
salt
xonsh
].freeze
private_constant :AUTOMATIC_RESOURCE_UPDATE_BLOCKLIST

@pipgrip_installed = nil

Expand All @@ -34,7 +39,7 @@ def update_pypi_url(url, version)
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"
Expand Down