From 764f3c636ee89be8d6826437abeb6d76e321074a Mon Sep 17 00:00:00 2001 From: David Hotham Date: Sat, 13 Nov 2021 20:34:20 +0000 Subject: [PATCH] Pick off some low-hanging fruit from mypy checks --- mypy.ini | 5 +---- poetry/locations.py | 5 +++-- poetry/plugins/plugin_manager.py | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/mypy.ini b/mypy.ini index 2bc2c873fa3..fd6e3c61bb4 100644 --- a/mypy.ini +++ b/mypy.ini @@ -28,7 +28,7 @@ ignore_errors = True [mypy-poetry.installation.*] ignore_errors = True -[mypy-poetry.locations.*] +[mypy-poetry.layouts.*] ignore_errors = True [mypy-poetry.mixology.*] @@ -37,9 +37,6 @@ ignore_errors = True [mypy-poetry.packages.*] ignore_errors = True -[mypy-poetry.plugins.*] -ignore_errors = True - [mypy-poetry.publishing.*] ignore_errors = True diff --git a/poetry/locations.py b/poetry/locations.py index b6b6f84681d..55496301585 100644 --- a/poetry/locations.py +++ b/poetry/locations.py @@ -15,7 +15,8 @@ def data_dir() -> Path: - if os.getenv("POETRY_HOME"): - return Path(os.getenv("POETRY_HOME")).expanduser() + poetry_home = os.getenv("POETRY_HOME") + if poetry_home: + return Path(poetry_home).expanduser() return Path(user_data_dir("pypoetry", roaming=True)) diff --git a/poetry/plugins/plugin_manager.py b/poetry/plugins/plugin_manager.py index c24ad2b20c1..ce4bd2ea28a 100644 --- a/poetry/plugins/plugin_manager.py +++ b/poetry/plugins/plugin_manager.py @@ -19,7 +19,7 @@ class PluginManager: def __init__(self, type, disable_plugins=False): # type: (str, bool) -> None self._type = type self._disable_plugins = disable_plugins - self._plugins = [] + self._plugins: List[Plugin] = [] def load_plugins(self): # type: () -> None if self._disable_plugins: