<#372 Install local project in uv script> Pull req...
# flyte-github
a
#372 Install local project in uv script Pull request opened by pingsutw This pull request introduces support for handling local Python projects specified via
file://
dependencies in uvscript files, improving image building workflows to include these projects as layers. The changes parse and separate standard dependencies from local project references, update image layer construction to include these projects, and ensure proper hashing and Dockerfile generation for reproducible builds. • Updated
parse_uv_script_file
in
uv_script_parser.py
to distinguish between standard dependencies and local projects (
file://
), storing them separately in the
UVScriptMetadata
dataclass. This enables downstream logic to handle local projects distinctly from regular dependencies. [1] [2] • Use the with_uv_project to install the local project # /// script # dependencies = [ # "polars", # "ty", # "mypy", # "flyte @ file:///Users/kevin/git/flyte-sdk", # ] # /// import polars as pl import flyte env = flyte.TaskEnvironment( name="hello_world", image=flyte.Image.from_uv_script(file, name="flyte", registry="ghcr.io/flyteorg"), ) @env.task async def create_dataframe() -> pl.DataFrame: return pl.DataFrame( {"name": ["Alice", "Bob", "Charlie"], "age": [25, 32, 37], "city": ["New York", "Paris", "Berlin"]} ) @env.task async def print_dataframe(dataframe: pl.DataFrame): print(dataframe) @env.task async def workflow(): df = await create_dataframe() await print_dataframe(df) if name == "__main__": flyte.init_from_config() r = flyte.run(workflow) print(r) flyteorg/flyte-sdk