From 72962d4106f1f202a273e9397f28bffff2feb25c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 26 Jun 2023 14:35:25 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- piptools/resolver.py | 4 +++- tests/test_cli_compile.py | 19 ++++++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/piptools/resolver.py b/piptools/resolver.py index 10d8aea18..b6d2e1378 100644 --- a/piptools/resolver.py +++ b/piptools/resolver.py @@ -504,7 +504,9 @@ def __init__( self.existing_constraints = existing_constraints # Categorize InstallRequirements into sets by key - constraints_sets: DefaultDict[str, set[InstallRequirement]] = collections.defaultdict(set) + constraints_sets: DefaultDict[ + str, set[InstallRequirement] + ] = collections.defaultdict(set) for ireq in constraints: constraints_sets[key_from_ireq(ireq)].add(ireq) # Collapse each set of InstallRequirements using combine_install_requirements diff --git a/tests/test_cli_compile.py b/tests/test_cli_compile.py index 3857e9d41..8117c95d3 100644 --- a/tests/test_cli_compile.py +++ b/tests/test_cli_compile.py @@ -1908,6 +1908,7 @@ def test_upgrade_package_doesnt_remove_annotation(pip_conf, runner): """ ) + @pytest.mark.parametrize(("num_inputs"), (2, 3, 10)) def test_many_inputs_includes_all_annotations(pip_conf, runner, num_inputs): """ @@ -1928,13 +1929,21 @@ def test_many_inputs_includes_all_annotations(pip_conf, runner, num_inputs): "--quiet", "--no-header", "--no-emit-find-links", - ] + in_files, + ] + + in_files, ) assert out.exit_code == 0, out.stderr - assert out.stdout == "\n".join([ - "small-fake-a==0.1", - " # via", - ] + [f" # -r {in_file}" for in_file in in_files]) + "\n" + assert ( + out.stdout + == "\n".join( + [ + "small-fake-a==0.1", + " # via", + ] + + [f" # -r {in_file}" for in_file in in_files] + ) + + "\n" + ) @pytest.mark.parametrize(