'Write shared location information to the SHARED file in .dist-info.
:param paths: A dictionary as described in the documentation for
:meth:`shared_locations`.
:param dry_run: If True, the action is logged but no file is actually
written.
:return: The path of the file written to.'

def write_shared_locations(self, paths, dry_run=False):

    shared_path = os.path.join(self.path, u'SHARED')
    logger.info(u'creating    %s', shared_path)
    if dry_run:
        return None
    lines = []
    for key in (u'prefix', u'lib', u'headers', u'scripts', u'data'):
        path = paths[key]
        if os.path.isdir(paths[key]):
            lines.append((u'%s=%s' % (key, path)))
    for ns in paths.get(u'namespace', ()):
        lines.append((u'namespace=%s' % ns))
    with codecs.open(shared_path, u'w', encoding=u'utf-8') as f:
        f.write(u'\n'.join(lines))
    return shared_path
