Skip to content

Instantly share code, notes, and snippets.

  • Save CJ-Wright/0c61c0164041a4b40ac7687ffbf9d3df to your computer and use it in GitHub Desktop.
Save CJ-Wright/0c61c0164041a4b40ac7687ffbf9d3df to your computer and use it in GitHub Desktop.
import os
from conda_build import api
from conda_build.config import Config
from json import dumps
from rever.tools import hash_url
def pp(jason):
print(dumps(jason, indent=4, sort_keys=True))
def main():
recipe_dir = os.getcwd()
config = Config({'variant_config_files': ['/opt/Shared.local/r/a/conda_build_config.yaml']})
urls = set()
for subdir in ['win-32', 'win-64', 'linux-64', 'osx-64']:
config.host_subdir = subdir
config.target_subdir = subdir
metadatas = api.render(recipe_dir, config=config)
for metadata_temp in metadatas:
metadata, _, _ = metadata_temp
for sources_index, sources in enumerate(metadata.meta['source']):
urls.add(sources['url'])
print(urls)
for url in sorted(list(urls)):
hash = hash_url(url)
print('{} : {}'.format(url, hash))
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment