def check_metadata(self):
        """Ensures that all required elements of meta-data are supplied.

        Required fields:
            name, version

        Warns if any are missing.
        """
        metadata = self.distribution.metadata

        missing = []
        for attr in 'name', 'version':
            if not getattr(metadata, attr, None):
                missing.append(attr)

        if missing:
            self.warn("missing required meta-data: %s" % ', '.join(missing))
Ensures that all required elements of meta-data are supplied.

        Required fields:
            name, version

        Warns if any are missing.
        
product/gradle-plugin/src/main/python/setuptools/_distutils/command/check.py