Skip to content

Commit

Permalink
Handle package name discrepancies
Browse files Browse the repository at this point in the history
  • Loading branch information
snejus committed Apr 27, 2020
1 parent 9ca4d3f commit 216e6e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions poetry/console/commands/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ def handle(self):

return 0

required_by = {}
for parent in locked_packages:
children = {d.pretty_name: d.pretty_constraint for d in parent.requires}
required_by = {} # type: Dict[str, str]
for locked in locked_packages:
dependencies = {d.name: d.pretty_constraint for d in locked.requires}

if pkg.pretty_name in children:
required_by[parent.pretty_name] = children[pkg.pretty_name]
if pkg.name in dependencies:
required_by[locked.pretty_name] = dependencies[pkg.name]

rows = [
["<info>name</>", " : <c1>{}</>".format(pkg.pretty_name)],
Expand Down
2 changes: 1 addition & 1 deletion tests/console/commands/test_show.py
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@ def test_show_specific_package(app, poetry, installed):
cachy2.add_dependency("msgpack-python", ">=0.5 <0.6")

pendulum = get_package("pendulum", "2.0.0")
pendulum.add_dependency("cachy", "^0.2.0")
pendulum.add_dependency("CachY", "^0.2.0")

installed.add_package(cachy2)
installed.add_package(pendulum)
Expand Down

0 comments on commit 216e6e2

Please sign in to comment.