Document PyPi.
This commit is contained in:
parent
5cd8b609f7
commit
6a3b9149e0
@ -22,7 +22,6 @@ Style/Documentation:
|
|||||||
- 'utils/gems.rb'
|
- 'utils/gems.rb'
|
||||||
- 'utils/notability.rb'
|
- 'utils/notability.rb'
|
||||||
- 'utils/popen.rb'
|
- 'utils/popen.rb'
|
||||||
- 'utils/pypi.rb'
|
|
||||||
- 'utils/shebang.rb'
|
- 'utils/shebang.rb'
|
||||||
- 'utils/shell.rb'
|
- 'utils/shell.rb'
|
||||||
- 'utils/spdx.rb'
|
- 'utils/spdx.rb'
|
||||||
|
|||||||
@ -1,9 +1,13 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
# Helper functions for updating PyPi resources.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
module PyPI
|
module PyPI
|
||||||
module_function
|
module_function
|
||||||
|
|
||||||
PYTHONHOSTED_URL_PREFIX = "https://files.pythonhosted.org/packages/"
|
PYTHONHOSTED_URL_PREFIX = "https://files.pythonhosted.org/packages/"
|
||||||
|
private_constant :PYTHONHOSTED_URL_PREFIX
|
||||||
|
|
||||||
AUTOMATIC_RESOURCE_UPDATE_BLOCKLIST = %w[
|
AUTOMATIC_RESOURCE_UPDATE_BLOCKLIST = %w[
|
||||||
ansible
|
ansible
|
||||||
@ -17,6 +21,7 @@ module PyPI
|
|||||||
salt
|
salt
|
||||||
xonsh
|
xonsh
|
||||||
].freeze
|
].freeze
|
||||||
|
private_constant :AUTOMATIC_RESOURCE_UPDATE_BLOCKLIST
|
||||||
|
|
||||||
@pipgrip_installed = nil
|
@pipgrip_installed = nil
|
||||||
|
|
||||||
@ -34,7 +39,7 @@ module PyPI
|
|||||||
url
|
url
|
||||||
end
|
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)
|
def get_pypi_info(package, version)
|
||||||
metadata_url = "https://pypi.org/pypi/#{package}/#{version}/json"
|
metadata_url = "https://pypi.org/pypi/#{package}/#{version}/json"
|
||||||
out, _, status = curl_output metadata_url, "--location"
|
out, _, status = curl_output metadata_url, "--location"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user