From 195a8133482598f380e5205cbefccf0a845b2e12 Mon Sep 17 00:00:00 2001 From: Branch Vincent Date: Mon, 28 Feb 2022 21:58:07 -0500 Subject: [PATCH] chore(repositories): remove type errors --- pyproject.toml | 1 - src/poetry/repositories/installed_repository.py | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9801d51726a..94e1318c141 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -120,7 +120,6 @@ module = [ 'poetry.installation.executor', 'poetry.installation.installer', 'poetry.installation.pip_installer', - 'poetry.repositories.installed_repository', 'poetry.utils.env', ] ignore_errors = true diff --git a/src/poetry/repositories/installed_repository.py b/src/poetry/repositories/installed_repository.py index e1568df41c4..3afc6c1f638 100644 --- a/src/poetry/repositories/installed_repository.py +++ b/src/poetry/repositories/installed_repository.py @@ -106,7 +106,7 @@ def create_package_from_distribution( ) -> Package: # We first check for a direct_url.json file to determine # the type of package. - path = Path(str(distribution._path)) + path = Path(str(distribution._path)) # type: ignore[attr-defined] if ( path.name.endswith(".dist-info") @@ -172,7 +172,7 @@ def create_package_from_distribution( @classmethod def create_package_from_pep610(cls, distribution: metadata.Distribution) -> Package: - path = Path(str(distribution._path)) + path = Path(str(distribution._path)) # type: ignore[attr-defined] source_type = None source_url = None source_reference = None @@ -233,14 +233,14 @@ def load(cls, env: Env, with_dependencies: bool = False) -> InstalledRepository: for entry in reversed(env.sys_path): for distribution in sorted( metadata.distributions(path=[entry]), - key=lambda d: str(d._path), + key=lambda d: str(d._path), # type: ignore[attr-defined] ): name = canonicalize_name(distribution.metadata["name"]) if name in seen: continue - path = Path(str(distribution._path)) + path = Path(str(distribution._path)) # type: ignore[attr-defined] try: path.relative_to(_VENDORS)