Skip to content

Commit

Permalink
Improve readability of extra stripping and fix typo
Browse files Browse the repository at this point in the history
Co-authored-by: chrysle <fritzihab@posteo.de>
  • Loading branch information
chludwig-haufe and chrysle committed Sep 7, 2023
1 parent 112c433 commit 8439d8b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions piptools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ def key_no_extra_from_req(
) -> str:
"""Get an all-lowercase version of the requirement's name without any extras."""
name = req.name
extra_start_index = name.find("[")
package_name = name if extra_start_index == -1 else name[:extra_start_index]
package_name = name.split("[", 1)[0]
return str(canonicalize_name(package_name))


Expand Down
2 changes: 1 addition & 1 deletion tests/test_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ def wrap_resolution_impossible(*args, **kwargs):
# resolver has been rigged to raise a DistributionNotFound exception with
# a cause that refers to the entries of conflicting_ireqs.
# We expect _do_resolve() to handle this exception by dropping
# the these entries from existing_constraints and returning False.
# these entries from existing_constraints and returning False.
# It should _not_ drop any compatible constraint or re-raise
# the DistributionNotFound exception.
result = bt_resolver._do_resolve(resolver, existing_constraints)
Expand Down

0 comments on commit 8439d8b

Please sign in to comment.