Ejemplo n.º 1
0
    def _warn_about_conflicts(self, conflict_details, new_resolver):
        # type: (ConflictDetails, bool) -> None
        package_set, (missing, conflicting) = conflict_details
        if not missing and not conflicting:
            return

        parts = []  # type: List[str]
        if not new_resolver:
            parts.append(
                "After October 2020 you may experience errors when installing "
                "or updating packages. This is because pip will change the "
                "way that it resolves dependency conflicts.\n")
            parts.append(
                "We recommend you use --use-feature=2020-resolver to test "
                "your packages with the new resolver before it becomes the "
                "default.\n")
        elif not today_is_later_than(year=2020, month=7, day=31):
            # NOTE: trailing newlines here are intentional
            parts.append(
                "Pip will install or upgrade your package(s) and its "
                "dependencies without taking into account other packages you "
                "already have installed. This may cause an uncaught "
                "dependency conflict.\n")
            form_link = "https://forms.gle/cWKMoDs8sUVE29hz9"
            parts.append(
                "If you would like pip to take your other packages into "
                "account, please tell us here: {}\n".format(form_link))

        # NOTE: There is some duplication here, with commands/check.py
        for project_name in missing:
            version = package_set[project_name][0]
            for dependency in missing[project_name]:
                message = ("{name} {version} requires {requirement}, "
                           "which is not installed.").format(
                               name=project_name,
                               version=version,
                               requirement=dependency[1],
                           )
                parts.append(message)

        for project_name in conflicting:
            version = package_set[project_name][0]
            for dep_name, dep_version, req in conflicting[project_name]:
                message = (
                    "{name} {version} requires {requirement}, but you'll have "
                    "{dep_name} {dep_version} which is incompatible.").format(
                        name=project_name,
                        version=version,
                        requirement=req,
                        dep_name=dep_name,
                        dep_version=dep_version,
                    )
                parts.append(message)

        logger.critical("\n".join(parts))

        logger.critical("\n".join(parts))
Ejemplo n.º 2
0
                "pip's dependency resolver does not currently take into account "
                "all the packages that are installed. This behaviour is the "
                "source of the following dependency conflicts."
=======
        if not new_resolver:
            parts.append(
                "After October 2020 you may experience errors when installing "
                "or updating packages. This is because pip will change the "
                "way that it resolves dependency conflicts.\n"
            )
            parts.append(
                "We recommend you use --use-feature=2020-resolver to test "
                "your packages with the new resolver before it becomes the "
                "default.\n"
            )
        elif not today_is_later_than(year=2020, month=7, day=31):
            # NOTE: trailing newlines here are intentional
            parts.append(
                "Pip will install or upgrade your package(s) and its "
                "dependencies without taking into account other packages you "
                "already have installed. This may cause an uncaught "
                "dependency conflict.\n"
            )
            form_link = "https://forms.gle/cWKMoDs8sUVE29hz9"
            parts.append(
                "If you would like pip to take your other packages into "
                "account, please tell us here: {}\n".format(form_link)
>>>>>>> 74c061954d5e927be4caafbd793e96a50563c265
            )

        # NOTE: There is some duplication here, with commands/check.py