def _get_importlib_metadata_metadata(package_name):
    """Retrieve all the metadata for the given package."""
    import sys
    import importlib_metadata
    import json
    result = dict(importlib_metadata.metadata(package_name).items())
    keys = frozenset(('Platform', 'Supported-Platform', 'Classifier',
        'Provides-Dist', 'Requires-Dist', 'Requires-External',
        'Project-URL', 'Provides-Extra'))
    for key in keys:
        value = importlib_metadata.metadata(package_name).get_all(key)
        if value:
            result[key] = value
    print(json.dumps(result))
    sys.exit(0)
