Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] authored and chrysle committed May 12, 2024
1 parent aa4f8a0 commit 75ece2a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
10 changes: 7 additions & 3 deletions piptools/_compat/pip_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
15 changes: 13 additions & 2 deletions piptools/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 75ece2a

Please sign in to comment.