How to use the pyp2rpm.name_convertor.NameConvertor.rpm_versioned_name 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_name_convertor.py View on Github external
def test_rpm_versioned_name(self, name, version, expected):
        assert NameConvertor.rpm_versioned_name(name, version) == expected
github fedora-python / pyp2rpm / pyp2rpm / filters.py View on Github external
def name_for_python_version(name, version, default_number=False):
    return name_convertor.NameConvertor.rpm_versioned_name(
        name, version, default_number, True)
github fedora-python / pyp2rpm / pyp2rpm / name_convertor.py View on Github external
present in this class just for API compatibility reason
        Returns:
            Converted name of the package, that should be in line with
            Fedora Packaging Guidelines. If for_python is not None,
            the returned name is in form python%(version)s-%(name)s
        """
        logger.debug("Converting name: {0} to rpm name, version: {1}.".format(
            name, python_version))
        rpmized_name = self.base_name(name)

        rpmized_name = 'python-{0}'.format(rpmized_name)

        if self.distro == 'mageia':
            rpmized_name = rpmized_name.lower()
        logger.debug('Rpmized name of {0}: {1}.'.format(name, rpmized_name))
        return NameConvertor.rpm_versioned_name(rpmized_name, python_version)