Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
madhur-ob committed May 15, 2024
1 parent fde2a37 commit 61d7a6d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion metaflow/_vendor/vendor_any.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
click==7.1.2
packaging==23.0
packaging==23.0
21 changes: 10 additions & 11 deletions metaflow/click_api.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 61d7a6d

Please sign in to comment.