Skip to content

Commit 61d7a6d

Browse files
committed
minor fix
1 parent fde2a37 commit 61d7a6d

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

metaflow/_vendor/vendor_any.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
click==7.1.2
2-
packaging==23.0
2+
packaging==23.0

metaflow/click_api.py

+10-11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
import sys
2+
3+
if sys.version_info < (3, 7):
4+
raise RuntimeError(
5+
"""
6+
The Metaflow Programmatic API requires 'typeguard', which is not supported for python 3.5 and 3.6.
7+
"""
8+
)
9+
110
import inspect
211
import importlib
312
import itertools
@@ -17,6 +26,7 @@
1726
from metaflow._vendor import click
1827
from metaflow.parameters import JSONTypeClass
1928
from metaflow.includefile import FilePathClass
29+
from metaflow._vendor.typeguard import check_type, TypeCheckError
2030
from metaflow._vendor.click.types import (
2131
StringParamType,
2232
IntParamType,
@@ -30,17 +40,6 @@
3040
File,
3141
)
3242

33-
try:
34-
from typeguard import check_type, TypeCheckError
35-
except ImportError:
36-
raise ImportError(
37-
"""
38-
The Metaflow Programmatic API requires 'typeguard', which is not installed or available.
39-
Please try installing with `pip install typeguard`. This package and thus, the programmatic API
40-
functionality is unavailable for python 3.5 and 3.6.
41-
"""
42-
)
43-
4443
click_to_python_types = {
4544
StringParamType: str,
4645
IntParamType: int,

0 commit comments

Comments
 (0)