flytekit
flytekit copied to clipboard
Allow for flytekit version to be specified in default image builder
Why are the changes needed?
With 1.13.0, the default image builder does not allow flytekit to be specified to a specific version. For example, the following will fail:
from flytekit import ImageSpec, task
image1 = ImageSpec(
packages=["numpy==1.26.4", "flytekit==1.12.3"],
builder="default",
)
@task(container_image=image1)
def work():
pass
pyflyte build build_flyte.py work
with:
0.220 × No solution found when resolving dependencies:
0.221 ╰─▶ Because you require flytekit==1.13.0 and flytekit==1.12.3, we can
0.221 conclude that the requirements are unsatisfiable.
What changes were proposed in this pull request?
With this PR, we check for flytekit first. If it is not detected in requirements, then we inject flytekit into the requirements with the version used during registration.
How was this patch tested?
Unit test was added to this PR.