Commit 9b8d8304 by Edwin Yllanes Committed by GitHub

chore(console): remove type errors (#5258)

* chore(console/application): remove type errors

* chore(console/logging): remove type errors

* chore(utils/setup_reader): some fixes

* Revert "chore(utils/setup_reader): some fixes"

This reverts commit 9d82be920ea3d3c0fb0b818b29a1be3b82819b1c.
parent 1732d4c1
...@@ -112,8 +112,6 @@ files = "src" ...@@ -112,8 +112,6 @@ files = "src"
[[tool.mypy.overrides]] [[tool.mypy.overrides]]
module = [ module = [
'poetry.console.application',
'poetry.console.logging.formatters.builder_formatter',
'poetry.console.commands.init', 'poetry.console.commands.init',
'poetry.inspection.info', 'poetry.inspection.info',
'poetry.installation.chef', 'poetry.installation.chef',
......
...@@ -93,7 +93,7 @@ class Application(BaseApplication): ...@@ -93,7 +93,7 @@ class Application(BaseApplication):
def __init__(self) -> None: def __init__(self) -> None:
super().__init__("poetry", __version__) super().__init__("poetry", __version__)
self._poetry = None self._poetry: Poetry | None = None
self._io: IO | None = None self._io: IO | None = None
self._disable_plugins = False self._disable_plugins = False
self._plugins_loaded = False self._plugins_loaded = False
...@@ -232,8 +232,8 @@ class Application(BaseApplication): ...@@ -232,8 +232,8 @@ class Application(BaseApplication):
handler = IOHandler(io) handler = IOHandler(io)
handler.setFormatter(IOFormatter()) handler.setFormatter(IOFormatter())
for logger in loggers: for name in loggers:
logger = logging.getLogger(logger) logger = logging.getLogger(name)
logger.handlers = [handler] logger.handlers = [handler]
......
from __future__ import annotations from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
import logging
class Formatter: class Formatter:
def format(self, record: logging.LogRecord) -> str: def format(self, record: str) -> str:
raise NotImplementedError() raise NotImplementedError()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment