From 75ece2a0c251de1e232481f2fceb9073daf3766f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 12 May 2024 12:50:47 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- piptools/_compat/pip_compat.py | 10 +++++++--- piptools/resolver.py | 15 +++++++++++++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/piptools/_compat/pip_compat.py b/piptools/_compat/pip_compat.py index 1d346bdf..59bb72db 100644 --- a/piptools/_compat/pip_compat.py +++ b/piptools/_compat/pip_compat.py @@ -52,9 +52,12 @@ def _from_pkg_resources(cls, dist: _PkgResourcesDist) -> Distribution: @classmethod def _from_importlib(cls, dist: _ImportLibDist) -> Distribution: - """Mimics pkg_resources.Distribution.requires for the case of no - extras. This doesn't fulfill that API's `extras` parameter but - satisfies the needs of pip-tools.""" + """Mimic pkg_resources.Distribution.requires for the case of no + extras. + + This doesn't fulfill that API's ``extras`` parameter but + satisfies the needs of pip-tools. + """ reqs = (Requirement.parse(req) for req in (dist._dist.requires or ())) requires = [ req @@ -65,6 +68,7 @@ def _from_importlib(cls, dist: _ImportLibDist) -> Distribution: class FileLink(Link): # type: ignore[misc] + """Wrapper for ``pip``'s ``Link`` class.""" _url: str @property diff --git a/piptools/resolver.py b/piptools/resolver.py index 91b77032..0782d967 100644 --- a/piptools/resolver.py +++ b/piptools/resolver.py @@ -341,8 +341,8 @@ def _resolve_one_round(self) -> tuple[bool, set[InstallRequirement]]: or updated. :returns: whether new constraints appeared in this round. If no - constraints were added or changed, this indicates a stable - configuration. + constraints were added or changed, this indicates a stable + configuration. """ # Sort this list for readability of terminal output constraints = sorted(self.constraints, key=key_from_ireq) @@ -553,7 +553,12 @@ def resolve(self, max_rounds: int = 10) -> set[InstallRequirement]: Find concrete package versions for all the given InstallRequirements and their recursive dependencies. +<<<<<<< HEAD :returns: a set of pinned ``InstallRequirement``\ s. +======= + + :returns: A set of pinned ``InstallRequirement``\ s. +>>>>>>> 5eca664... [pre-commit.ci] auto fixes from pre-commit.com hooks """ with update_env_context_manager( PIP_EXISTS_ACTION="i" @@ -660,8 +665,14 @@ def _do_resolve( """ Resolve dependencies based on resolvelib ``Resolver``. +<<<<<<< HEAD :returns: :py:data:`True` on successful resolution, otherwise remove problematic requirements from existing constraints and return false. +======= + :returns: :py:data:`True` on successful resolution, otherwise removes + problematic requirements from existing constraints and + returns :py:data:`False`. +>>>>>>> 5eca664... [pre-commit.ci] auto fixes from pre-commit.com hooks """ try: resolver.resolve(