Skip to content

Commit

Permalink
show poetry and poetry-core version in output of poetry about
Browse files Browse the repository at this point in the history
  • Loading branch information
finswimmer authored and abn committed Mar 9, 2022
1 parent b06658f commit 6485bc2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/poetry/console/commands/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@ class AboutCommand(Command):
description = "Shows information about Poetry."

def handle(self) -> None:
from poetry.utils._compat import metadata

self.line(
"""\
<info>Poetry - Package Management for Python</info>
f"""\
<info>Poetry - Package Management for Python
Version: {metadata.version('poetry')}
Poetry-Core Version: {metadata.version('poetry-core')}</info>
<comment>Poetry is a dependency manager tracking local dependencies of your projects\
and libraries.
Expand Down
8 changes: 7 additions & 1 deletion tests/console/commands/test_about.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@ def tester(command_tester_factory: CommandTesterFactory) -> CommandTester:


def test_about(tester: CommandTester):
from poetry.utils._compat import metadata

tester.execute()
expected = """\

expected = f"""\
Poetry - Package Management for Python
Version: {metadata.version('poetry')}
Poetry-Core Version: {metadata.version('poetry-core')}
Poetry is a dependency manager tracking local dependencies of your projects and\
libraries.
See https://github.com/python-poetry/poetry for more information.
Expand Down

0 comments on commit 6485bc2

Please sign in to comment.