Пример #1
0
def solve(specs: List[str], r: Resolve) -> Union[bool, Iterable[str]]:
    features = set()  # type: Set
    for spec in specs:
        if conda.config.platform == 'win32' and spec == 'python':
            continue
        # XXX: This does not work when a spec only contains the name,
        # and different versions of the package have different features.
        ms = MatchSpec(spec)
        for pkg in r.get_pkgs(ms, max_only=False):
            fn = pkg.fn
            features.update(r.track_features(fn))
    for spec in specs:
        for pkg in r.get_pkgs(MatchSpec(spec), max_only=False):
            fn = pkg.fn
            r.update_with_features(fn, features)

    print("Solving package specifications: ", end='')
    try:
        return r.explicit(specs) or r.solve2(specs,
                                             features,
                                             installed=(),
                                             minimal_hint=False,
                                             guess=False,
                                             unsat_only=True)
    except RuntimeError:
        print('\n')
        return False
Пример #2
0
def solve(specs: List[str], r: Resolve) -> Union[bool, Iterable[str]]:
    features = set()  # type: Set
    for spec in specs:
        if conda.config.platform == 'win32' and spec == 'python':
            continue
        # XXX: This does not work when a spec only contains the name,
        # and different versions of the package have different features.
        ms = MatchSpec(spec)
        for pkg in r.get_pkgs(ms, max_only=False):
            fn = pkg.fn
            features.update(r.track_features(fn))
    for spec in specs:
        for pkg in r.get_pkgs(MatchSpec(spec), max_only=False):
            fn = pkg.fn
            r.update_with_features(fn, features)

    print("Solving package specifications: ", end='')
    try:
        return r.explicit(specs) or r.solve2(specs, features,
           installed=(), minimal_hint=False, guess=False, unsat_only=True)
    except RuntimeError:
        print('\n')
        return False