How to use the distutils2.version.suggest_normalized_version 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 mongolab / mongoctl / mongoctl / mongodb_version.py View on Github external
def is_valid_version(version_number):
    return suggest_normalized_version(version_number) is not None
github johncosta / private-readthedocs.org / readthedocs / projects / utils.py View on Github external
def mkversion(version_obj):
    try:
        if hasattr(version_obj, 'slug'):
            ver =  NormalizedVersion(suggest_normalized_version(version_obj.slug))
        else:
            ver =  NormalizedVersion(suggest_normalized_version(version_obj['slug']))
        return ver
    except TypeError:
        return None
github nix-community / pypi2nix / plone2nix.py View on Github external
plonedeps = open("plonedeps", "r").read()
if __name__ == '__main__':
    #eggs = to_dict(sys.stdin.read())
    eggs = to_dict(plonedeps)
    pypi = Crawler()

    bad_eggs = []
    not_found = []
    version_error = []
    print PRE_TMPL

    for nixname in sorted(eggs.keys()):
        if nixname in system_packages: continue
        if nixname in ignore_packages: continue
        egg = eggs[nixname]
        version = suggest_normalized_version(egg['version'])
        name = egg['name']
        if egg['extras']:
            name += '-'.join(egg['extras'])
        name += '-' + egg['version']
        if version is None:
            version = ''
        try:
            egg_release = pypi.get_release(egg['name'] + '==' + egg['version'])
        except ProjectNotFound:
            not_found.append(egg['name'])
        except IrrationalVersionError:
            version_error.append(egg['name'])
        egg_dist = egg_release.dists['sdist'].url
        url = egg_dist['url']
        url = url.replace("http://a.pypi", "http://pypi")
        #metadata = nix_metadata(egg_release)
github domogik / domogik / src / domogik / install / upgrade.py View on Github external
def _suggest_normalized_version(self, version):
        n_version = suggest_normalized_version(version)
        if n_version is None:
            print("Error : invalid version number : %s" % version)
            print("See : http://wiki.domogik.org/Release_numbering")
            self._abort_install_process()
        else:
            return n_version
github nix-community / pypi2nix / python2nix / utils.py View on Github external
def to_nix_dict(egg, nixname):
    """Return a dict of the package attributes relevant to a nix
    expression
    """
    pypi = Crawler()

    name = egg['name']
    if egg['extras']:
        name += '-'.join(egg['extras'])
    name += '-' + egg['version']

    version = suggest_normalized_version(egg['version'])
    egg_release = pypi.get_release(egg['name'] + '==' + version)
    egg_dist = egg_release.dists['sdist'].url
    url = egg_dist['url']
    url = url.replace("http://a.pypi", "http://pypi")
    url = url.replace(name, "${name}")

    build_inputs = ''
    if url.endswith(".zip"):
        build_inputs = "\n    buildInputs = [ pkgs.unzip ];\n"

    propagated_build_inputs = ''
    if HARD_REQUIREMENTS.has_key(nixname):
        propagated_build_inputs = (
            "\n    propagatedBuildInputs = [ {0} ];\n"
        ).format(HARD_REQUIREMENTS[nixname])
github johncosta / private-readthedocs.org / readthedocs / projects / utils.py View on Github external
def mkversion(version_obj):
    try:
        if hasattr(version_obj, 'slug'):
            ver =  NormalizedVersion(suggest_normalized_version(version_obj.slug))
        else:
            ver =  NormalizedVersion(suggest_normalized_version(version_obj['slug']))
        return ver
    except TypeError:
        return None
github mongolab / mongoctl / mongoctl / mongodb_version.py View on Github external
def __init__(self, version_number, edition=None):
        sugg_ver = suggest_normalized_version(version_number)
        super(MongoDBVersionInfo,self).__init__(sugg_ver)
        self.version_number = version_number
        self.edition = edition or MongoDBEdition.COMMUNITY