Skip to content

Commit

Permalink
modify pip install command
Browse files Browse the repository at this point in the history
  • Loading branch information
connor-mccarthy committed Aug 16, 2023
1 parent 3435e74 commit 13889ba
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions sdk/python/kfp/dsl/component_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,10 @@ def _get_packages_to_install_command(
# themselves, we install KFP for them
inject_kfp_install = install_kfp_package and target_image is None and not kfp_in_user_pkgs
if inject_kfp_install:
kfp_package_path = kfp_package_path or _get_default_kfp_package_path()
packages_to_install.append(kfp_package_path)
if kfp_package_path:
packages_to_install.append(kfp_package_path)
else:
packages_to_install.extend(_get_injected_kfp_imports())

concat_package_list = ' '.join(
[repr(str(package)) for package in packages_to_install])
Expand All @@ -136,8 +138,11 @@ def _get_packages_to_install_command(
return ['_RUNTIME=true', 'sh', '-c', install_python_packages_script]


def _get_default_kfp_package_path() -> str:
return f'kfp=={kfp.__version__} --no-deps'
def _get_injected_kfp_imports() -> List[str]:
return [
f'kfp=={kfp.__version__} --no-deps',
'typing-extensions>=3.7.4,<5; python_version<"3.9"',
]


def _get_function_source_definition(func: Callable) -> str:
Expand Down

0 comments on commit 13889ba

Please sign in to comment.