Skip to content

Commit

Permalink
Added canonicalize_name() to console/commands/init.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Rittenhouse committed Jan 29, 2022
1 parent c1c74b9 commit fe6ffe6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/poetry/console/commands/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

from poetry.console.commands.command import Command
from poetry.console.commands.env_command import EnvCommand
from poetry.utils.helpers import canonicalize_name


if TYPE_CHECKING:
Expand Down Expand Up @@ -275,10 +276,14 @@ def _determine_requirements(
else:
choices = []
matches_names = [p.name for p in matches]
exact_match = constraint["name"] in matches_names
exact_match = canonicalize_name(constraint["name"]) in matches_names
if exact_match:
choices.append(
matches[matches_names.index(constraint["name"])].pretty_name
matches[
matches_names.index(
canonicalize_name(constraint["name"])
)
].pretty_name
)

for found_package in matches:
Expand Down

0 comments on commit fe6ffe6

Please sign in to comment.