Skip to content

Commit

Permalink
simplify importlib.metadata.version treatment
Browse files Browse the repository at this point in the history
  • Loading branch information
dimbleby authored and abn committed Mar 24, 2024
1 parent fafb6d7 commit c8ece56
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/poetry/console/commands/about.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
from __future__ import annotations

from typing import TYPE_CHECKING

from poetry.console.commands.command import Command


if TYPE_CHECKING:
from collections.abc import Callable


class AboutCommand(Command):
name = "about"

Expand All @@ -17,16 +11,12 @@ class AboutCommand(Command):
def handle(self) -> int:
from poetry.utils._compat import metadata

# The metadata.version that we import for Python 3.7 is untyped, work around
# that.
version: Callable[[str], str] = metadata.version

self.line(
f"""\
<info>Poetry - Package Management for Python
Version: {version('poetry')}
Poetry-Core Version: {version('poetry-core')}</info>
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

0 comments on commit c8ece56

Please sign in to comment.