From 5823c44c16bfe612d5b4da157bf575017e3413b3 Mon Sep 17 00:00:00 2001 From: chrysle Date: Mon, 26 Feb 2024 10:17:29 +0100 Subject: [PATCH] Brighten up docstrings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also remove unrelated `tox.ini` change. Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) --- docs/conf.py | 6 +++--- piptools/resolver.py | 12 +++++++----- tox.ini | 3 +-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index f05d2fa00..1db2152e6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -61,8 +61,6 @@ r"^https://img.shields.io/matrix", ] -suppress_warnings = ["myst.xref_missing"] - nitpick_ignore_regex = [ ("py:class", "pip.*"), ("py:class", "pathlib.*"), @@ -75,14 +73,16 @@ ("py:exc", "click.*"), ] +suppress_warnings = ["myst.xref_missing"] + # -- Apidoc options ------------------------------------------------------- apidoc_excluded_paths: list[str] = [] apidoc_extra_args = [ "--implicit-namespaces", "--private", # include “_private” modules ] -apidoc_module_dir = "../piptools" apidoc_module_first = False +apidoc_module_dir = "../piptools" apidoc_output_dir = "pkg" apidoc_separate_modules = True apidoc_toc_file = None diff --git a/piptools/resolver.py b/piptools/resolver.py index 3c036d071..c4f6318a8 100644 --- a/piptools/resolver.py +++ b/piptools/resolver.py @@ -185,9 +185,7 @@ def _filter_out_unsafe_constraints( class LegacyResolver(BaseResolver): """ - Resolve a given set of constraints (a collection of - InstallRequirement objects) by consulting the given Repository and the - DependencyCache. + Wrapper for the (deprecated) legacy dependency resolver. """ def __init__( @@ -201,6 +199,10 @@ def __init__( allow_unsafe: bool = False, unsafe_packages: set[str] | None = None, ) -> None: + """ + Make sure the legacy resolver is enabled and no backtracking resolver + is present. + """ self.our_constraints = set(constraints) self.their_constraints: set[InstallRequirement] = set() self.repository = repository @@ -423,7 +425,7 @@ def _iter_dependencies( self, ireq: InstallRequirement ) -> Iterator[InstallRequirement]: """ - Collect all secondary dependencies for an ireq. + Emit all secondary dependencies for an ireq. Given a pinned, url, or editable InstallRequirement, collects all the secondary dependencies for them, either by looking them up in a local @@ -640,7 +642,7 @@ def _do_resolve( compatible_existing_constraints: dict[str, InstallRequirement], ) -> bool: """ - Actual resolution process. + Resolve dependencies based resolvelib ``Resolver``. Return True on successful resolution, otherwise remove problematic requirements from existing constraints and return false. diff --git a/tox.ini b/tox.ini index bb740ee35..5ded61bbe 100644 --- a/tox.ini +++ b/tox.ini @@ -52,9 +52,8 @@ skip_install = true [testenv:pip-compile-docs] description = compile requirements for the documentation -changedir = {[testenv:build-docs]changedir} commands_pre = -commands = python -m piptools compile --strip-extras --allow-unsafe --quiet requirements.in {posargs} +commands = python -m piptools compile --strip-extras --allow-unsafe --quiet docs/requirements.in {posargs} [testenv:build-docs] description = build the documentation