From a318f64d55a396f3626a72abcafa20a1b18de369 Mon Sep 17 00:00:00 2001 From: Joshua Hoskins Date: Thu, 17 Sep 2020 14:10:42 -0700 Subject: [PATCH] feedback 2 remove utils, make mypy ignore missing imports module-specific --- amundsen_common/utils/__init__.py | 2 -- amundsen_common/utils/utils.py | 12 ------------ setup.cfg | 10 +++++++++- tests/unit/utils/__init__.py | 2 -- 4 files changed, 9 insertions(+), 17 deletions(-) delete mode 100644 amundsen_common/utils/__init__.py delete mode 100644 amundsen_common/utils/utils.py delete mode 100644 tests/unit/utils/__init__.py diff --git a/amundsen_common/utils/__init__.py b/amundsen_common/utils/__init__.py deleted file mode 100644 index f3145d7..0000000 --- a/amundsen_common/utils/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# Copyright Contributors to the Amundsen project. -# SPDX-License-Identifier: Apache-2.0 diff --git a/amundsen_common/utils/utils.py b/amundsen_common/utils/utils.py deleted file mode 100644 index b4780e9..0000000 --- a/amundsen_common/utils/utils.py +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright Contributors to the Amundsen project. -# SPDX-License-Identifier: Apache-2.0 - -from typing import Optional, TypeVar - -X = TypeVar('X') - - -def check_not_none(x: Optional[X], *, message: str = 'is None') -> X: - if x is None: - raise RuntimeError(message) - return x diff --git a/setup.cfg b/setup.cfg index 1f621cd..e47822b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -35,8 +35,16 @@ check_untyped_defs = true disallow_any_generics = true disallow_incomplete_defs = true disallow_untyped_defs = true -ignore_missing_imports = true no_implicit_optional = true +[mypy-marshmallow.*] +ignore_missing_imports = true + +[mypy-marshmallow_annotations.*] +ignore_missing_imports = true + +[mypy-setuptools.*] +ignore_missing_imports = true + [mypy-tests.*] disallow_untyped_defs = false diff --git a/tests/unit/utils/__init__.py b/tests/unit/utils/__init__.py deleted file mode 100644 index f3145d7..0000000 --- a/tests/unit/utils/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# Copyright Contributors to the Amundsen project. -# SPDX-License-Identifier: Apache-2.0