How to use the pyp2rpm.metadata_extractors.SetupPyMetadataExtractor function in pyp2rpm

To help you get started, we’ve selected a few pyp2rpm 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 fedora-python / pyp2rpm / tests / test_metadata_extractors.py View on Github external
def test_init_extractor(self, b_version, what, expected):
        extractor = me.SetupPyMetadataExtractor(
            '{0}netjsonconfig-0.5.1.tar.gz'.format(self.td_dir),
            'netjsonconfig', self.nc, '0.5.1', base_python_version=b_version)
        if extractor.unsupported_version != b_version:
            assert extractor.metadata.get(what) == expected
github fedora-python / pyp2rpm / tests / test_metadata_extractors.py View on Github external
def setup_method(self, method):
        # create fresh extractors for every test

        self.nc = NameConvertor('fedora')
        self.e = [me.SetupPyMetadataExtractor('{0}plumbum-0.9.0.tar.gz'.format(
            self.td_dir), 'plumbum', self.nc, '0.9.0'),
            me.SetupPyMetadataExtractor(
            '{0}pytest-2.2.3.zip'.format(self.td_dir), 'pytest',
                self.nc, '2.2.3'),
            me.SetupPyMetadataExtractor(
            '{0}bitarray-0.8.0.tar.gz'.format(self.td_dir), 'bitarray',
                self.nc, '0.8.0'),
            me.SetupPyMetadataExtractor(
            '{0}versiontools-1.9.1.tar.gz'.format(self.td_dir),
                'versiontools', self.nc, '1.9.1'),
            me.SetupPyMetadataExtractor(
            '{0}isholiday-0.1.tar.gz'.format(self.td_dir),
                'isholiday', self.nc, '0.1'),
        ]
github fedora-python / pyp2rpm / tests / test_metadata_extractors.py View on Github external
def setup_method(self, method):
        # create fresh extractors for every test

        self.nc = NameConvertor('fedora')
        self.e = [me.SetupPyMetadataExtractor('{0}plumbum-0.9.0.tar.gz'.format(
            self.td_dir), 'plumbum', self.nc, '0.9.0'),
            me.SetupPyMetadataExtractor(
            '{0}pytest-2.2.3.zip'.format(self.td_dir), 'pytest',
                self.nc, '2.2.3'),
            me.SetupPyMetadataExtractor(
            '{0}bitarray-0.8.0.tar.gz'.format(self.td_dir), 'bitarray',
                self.nc, '0.8.0'),
            me.SetupPyMetadataExtractor(
            '{0}versiontools-1.9.1.tar.gz'.format(self.td_dir),
                'versiontools', self.nc, '1.9.1'),
            me.SetupPyMetadataExtractor(
            '{0}isholiday-0.1.tar.gz'.format(self.td_dir),
                'isholiday', self.nc, '0.1'),
        ]
github fedora-python / pyp2rpm / tests / test_metadata_extractors.py View on Github external
def setup_method(self, method):
        self.nc = NameConvertor('fedora')
        # we will only test getting stuff from the client => pass spam as file
        self.e = me.SetupPyMetadataExtractor(
            '{0}pytest-2.2.3.zip'.format(self.td_dir), 'pytest',
            self.nc, '2.2.3')
github fedora-python / pyp2rpm / tests / test_metadata_extractors.py View on Github external
def setup_method(self, method):
        # create fresh extractors for every test

        self.nc = NameConvertor('fedora')
        self.e = [me.SetupPyMetadataExtractor('{0}plumbum-0.9.0.tar.gz'.format(
            self.td_dir), 'plumbum', self.nc, '0.9.0'),
            me.SetupPyMetadataExtractor(
            '{0}pytest-2.2.3.zip'.format(self.td_dir), 'pytest',
                self.nc, '2.2.3'),
            me.SetupPyMetadataExtractor(
            '{0}bitarray-0.8.0.tar.gz'.format(self.td_dir), 'bitarray',
                self.nc, '0.8.0'),
            me.SetupPyMetadataExtractor(
            '{0}versiontools-1.9.1.tar.gz'.format(self.td_dir),
                'versiontools', self.nc, '1.9.1'),
            me.SetupPyMetadataExtractor(
            '{0}isholiday-0.1.tar.gz'.format(self.td_dir),
                'isholiday', self.nc, '0.1'),
        ]
github fedora-python / pyp2rpm / pyp2rpm / metadata_extractors.py View on Github external
def __init__(self, *args, **kwargs):
        super(SetupPyMetadataExtractor, self).__init__(*args, **kwargs)

        temp_dir = tempfile.mkdtemp()
        try:
            with self.archive as package_archive:
                package_archive.extract_all(directory=temp_dir)
                self.metadata = self._get_metadata(temp_dir)
        finally:
            shutil.rmtree(temp_dir)