From f8ec0067259fc1105aa297179125832d35c88e58 Mon Sep 17 00:00:00 2001 From: brandon Date: Mon, 9 Jun 2025 16:20:35 -0700 Subject: [PATCH 1/3] disable mypy linting errors --- src/groundlight/optional_imports.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/groundlight/optional_imports.py b/src/groundlight/optional_imports.py index 405b137e..cacd408b 100644 --- a/src/groundlight/optional_imports.py +++ b/src/groundlight/optional_imports.py @@ -35,7 +35,7 @@ def __getattr__(self, key): # pylint: disable=bad-mcs-method-argument except ImportError as e: np = UnavailableModule(e) # Expose np.ndarray so type-hinting looks normal - np.ndarray = np # pylint: disable=attribute-defined-outside-init + np.ndarray = np # pylint: disable=attribute-defined-outside-init # type: ignore[attr-defined] MISSING_NUMPY = True try: @@ -46,7 +46,7 @@ def __getattr__(self, key): # pylint: disable=bad-mcs-method-argument except ImportError as e: PIL = UnavailableModule(e) Image = PIL - Image.Image = PIL # for type-hinting; pylint: disable=attribute-defined-outside-init + Image.Image = PIL # for type-hinting; pylint: disable=attribute-defined-outside-init # type: ignore[attr-defined] MISSING_PIL = True From ef7f294b21319964b857dc774e5d5beaddd2bd99 Mon Sep 17 00:00:00 2001 From: brandon Date: Mon, 9 Jun 2025 16:24:11 -0700 Subject: [PATCH 2/3] more general ignore --- src/groundlight/optional_imports.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/groundlight/optional_imports.py b/src/groundlight/optional_imports.py index cacd408b..e2a1e6b0 100644 --- a/src/groundlight/optional_imports.py +++ b/src/groundlight/optional_imports.py @@ -35,7 +35,7 @@ def __getattr__(self, key): # pylint: disable=bad-mcs-method-argument except ImportError as e: np = UnavailableModule(e) # Expose np.ndarray so type-hinting looks normal - np.ndarray = np # pylint: disable=attribute-defined-outside-init # type: ignore[attr-defined] + np.ndarray = np # pylint: disable=attribute-defined-outside-init # type: ignore MISSING_NUMPY = True try: @@ -46,7 +46,7 @@ def __getattr__(self, key): # pylint: disable=bad-mcs-method-argument except ImportError as e: PIL = UnavailableModule(e) Image = PIL - Image.Image = PIL # for type-hinting; pylint: disable=attribute-defined-outside-init # type: ignore[attr-defined] + Image.Image = PIL # for type-hinting; pylint: disable=attribute-defined-outside-init # type: ignore MISSING_PIL = True From 188f0be686df0707a79df41b405d77559523e9fa Mon Sep 17 00:00:00 2001 From: brandon Date: Mon, 9 Jun 2025 16:28:20 -0700 Subject: [PATCH 3/3] mypy and pylint don't always play nice --- src/groundlight/optional_imports.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/groundlight/optional_imports.py b/src/groundlight/optional_imports.py index e2a1e6b0..a7e8df28 100644 --- a/src/groundlight/optional_imports.py +++ b/src/groundlight/optional_imports.py @@ -35,7 +35,7 @@ def __getattr__(self, key): # pylint: disable=bad-mcs-method-argument except ImportError as e: np = UnavailableModule(e) # Expose np.ndarray so type-hinting looks normal - np.ndarray = np # pylint: disable=attribute-defined-outside-init # type: ignore + np.ndarray = np # type: ignore # pylint: disable=attribute-defined-outside-init MISSING_NUMPY = True try: @@ -46,7 +46,7 @@ def __getattr__(self, key): # pylint: disable=bad-mcs-method-argument except ImportError as e: PIL = UnavailableModule(e) Image = PIL - Image.Image = PIL # for type-hinting; pylint: disable=attribute-defined-outside-init # type: ignore + Image.Image = PIL # type: ignore # for type-hinting; pylint: disable=attribute-defined-outside-init MISSING_PIL = True