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 AndydeCleyre committed Jun 26, 2023
1 parent 9cac013 commit 72962d4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
4 changes: 3 additions & 1 deletion piptools/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 14 additions & 5 deletions tests/test_cli_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand All @@ -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(
Expand Down

0 comments on commit 72962d4

Please sign in to comment.