'Generate requirements from setup.cfg as
(\'Requires-Dist\', \'requirement; qualifier\') tuples. From a metadata
section in setup.cfg:
[metadata]
provides-extra = extra1
extra2
requires-dist = requirement; qualifier
another; qualifier2
unqualified
Yields
(\'Provides-Extra\', \'extra1\'),
(\'Provides-Extra\', \'extra2\'),
(\'Requires-Dist\', \'requirement; qualifier\'),
(\'Requires-Dist\', \'another; qualifier2\'),
(\'Requires-Dist\', \'unqualified\')'

def setupcfg_requirements(self):

    metadata = self.distribution.get_option_dict('metadata')
    for (key, title) in (('provides_extra', 'Provides-Extra'), ('requires_dist', 'Requires-Dist')):
        if (not (key in metadata)):
            continue
        field = metadata[key]
        for line in field[1].splitlines():
            line = line.strip()
            if (not line):
                continue
            (yield (title, line))
