diff --git a/metaflow/_vendor/vendor_any.txt b/metaflow/_vendor/vendor_any.txt index 3c14abc1933..9c48802aae6 100644 --- a/metaflow/_vendor/vendor_any.txt +++ b/metaflow/_vendor/vendor_any.txt @@ -1,2 +1,2 @@ click==7.1.2 -packaging==23.0 \ No newline at end of file +packaging==23.0 diff --git a/metaflow/click_api.py b/metaflow/click_api.py index 5588b6e831d..7ef84870076 100644 --- a/metaflow/click_api.py +++ b/metaflow/click_api.py @@ -1,3 +1,12 @@ +import sys + +if sys.version_info < (3, 7): + raise RuntimeError( + """ + The Metaflow Programmatic API requires 'typeguard', which is not supported for python 3.5 and 3.6. + """ + ) + import inspect import importlib import itertools @@ -17,6 +26,7 @@ from metaflow._vendor import click from metaflow.parameters import JSONTypeClass from metaflow.includefile import FilePathClass +from metaflow._vendor.typeguard import check_type, TypeCheckError from metaflow._vendor.click.types import ( StringParamType, IntParamType, @@ -30,17 +40,6 @@ File, ) -try: - from typeguard import check_type, TypeCheckError -except ImportError: - raise ImportError( - """ - The Metaflow Programmatic API requires 'typeguard', which is not installed or available. - Please try installing with `pip install typeguard`. This package and thus, the programmatic API - functionality is unavailable for python 3.5 and 3.6. - """ - ) - click_to_python_types = { StringParamType: str, IntParamType: int,