Ejemplo n.º 1
0
def is_prerelease(vers):
    """
    Attempt to determine if this is a pre-release using PEP386/PEP426 rules.

    Will return True if it is a pre-release and False if not. Versions are
    assumed to be a pre-release if they cannot be parsed.
    """
    normalized = version._suggest_normalized_version(vers)

    if normalized is None:
        # Cannot normalize, assume it is a pre-release
        return True

    if version._normalized_key.__name__ == "_pep_440_key":
        parsed = version._normalized_key(normalized)[1:]
    else:
        parsed = version._normalized_key(normalized)
    return any([any([y in set(["a", "b", "c", "rc", "dev"]) for y in x]) for x in parsed])
Ejemplo n.º 2
0

def is_prerelease(vers):
    """
    Attempt to determine if this is a pre-release using PEP386/PEP426 rules.

    Will return True if it is a pre-release and False if not. Versions are
    assumed to be a pre-release if they cannot be parsed.
    """
    normalized = version._suggest_normalized_version(vers)

    if normalized is None:
        # Cannot normalize, assume it is a pre-release
        return True

    parsed = version._normalized_key(normalized)
    return any([any([y in set(["a", "b", "c", "rc", "dev"]) for y in x]) for x in parsed])
<<<<<<< HEAD


class BuildDirectory(object):

    def __init__(self, name=None, delete=None):
        # If we were not given an explicit directory, and we were not given an
        # explicit delete option, then we'll default to deleting.
        if name is None and delete is None:
            delete = True

        if name is None:
            name = tempfile.mkdtemp(prefix="pip-build-")
            # If we were not given an explicit directory, and we were not given