Created
July 5, 2020 21:50
-
-
Save chenrui333/cafafb9050e36c7f517542975d05b326 to your computer and use it in GitHub Desktop.
Updated resource blocks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from https://github.com/Homebrew/homebrew-core/pull/57500 | |
# Updated resource blocks generated with: https://repl.it/repls/AnchoredCultivatedModem | |
require 'open-uri' | |
require 'json' | |
pnames = %w[ | |
attrs | |
certifi | |
cffi | |
chardet | |
click | |
click_config_file | |
configobj | |
configparser | |
cookies | |
httplib2 | |
idna | |
importlib_metadata | |
jsonschema | |
launchpadlib | |
lazr.restfulclient | |
lazr.uri | |
libnacl | |
more_itertools | |
mypy_extensions | |
oauthlib | |
pbr | |
petname | |
pylxd | |
progressbar33 | |
pycparser | |
pyelftools | |
pymacaroons | |
PyNaCl | |
pyrsistent | |
pysha3 | |
python-debian | |
pyxdg | |
PyYAML | |
raven | |
requests | |
requests-toolbelt | |
requests-unixsocket | |
responses | |
simplejson | |
six | |
tabulate | |
urllib3 | |
wadllib | |
zipp | |
] | |
# pymacaroons-pynacl is hosted on github | |
resources = [] | |
for pname in pnames | |
content = open("https://pypi.org/pypi/#{pname}/json").read | |
json = JSON.parse(content) | |
lversion = json["info"]["version"] | |
sdist = json["releases"][lversion].find { |pkg| pkg['packagetype'] == 'sdist' } | |
url = sdist['url'] | |
sha = sdist['digests']['sha256'] | |
puts <<-eos | |
resource "#{pname}" do | |
url "#{url}" | |
sha256 "#{sha}" | |
end | |
eos | |
puts '' | |
end | |
# puts resources[0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment