How to use the distutils2.metadata.DistributionMetadata function in Distutils2

To help you get started, we’ve selected a few Distutils2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ryppl / __legacy / src / ryppl / canonical_setup.py View on Github external
# install the .egg-info for this guy
                install_egg_info_cmd = self.get_finalized_command('install_egg_info')
                install_egg_info_cmd.run()

                # Copy the install_manifest.txt to the install record file
                shutil.copy2(os.path.join(self.build_base, 'install_manifest.txt'), self.record)

                # Add the .egg-info directory and its contents to the install_record.txt
                open(self.record, 'a+').write( '\n'.join(install_egg_info_cmd.get_outputs())+'\n' )

            else:
                _install.run(self)

# Read the metadata out of the project's .ryppl/METADATA file
metadata = DistributionMetadata(
    path=os.path.join(os.getcwd(), '.ryppl', 'METADATA'),
    platform_dependant=True
    )

def metadata_to_setup_keywords(metadata):
    """
    Convert a Distutils2 metadata object into a dict of named
    arguments to be passed to setup()
    """
    if use_distutils2:
        # Everything *should* be this easy.
        return dict( metadata.items() )
    else:
        class item_to_attribute(object):
            """
            because I hate seeing identifiers between quotes