Closed robfreedy closed 2 months ago
MRE
my_script.py
from prefect import flow
if __name__ == "__main__":
flow.from_source(
source="https://github.com/PrefectHQ/hello-projects.git",
entrypoint="flows/pandas_flow.py:pandas_flow",
).deploy(
name="pandas-deployment-from-github",
work_pool_name="local-pool", # use the name of an existing pool
)
First check
Prefect Version
3.x
Describe the current behavior
In the 2.19.3 release, users have the ability to run the
prefect deploy
command to create a deployment for a flow without having to have the flow's dependencies installed in the environment.However, when deploying a flow using the from_source().deploy() method of deploying a flow, the dependencies for the flow need to be present.
Describe the proposed behavior
Ability to use from_source() and .deploy() to create/update a deployment for a flow without having the flow's dependencies in the environment that the from_source() and .deploy() are run in.
Example Use
Being able to run the deployment code below in an environment that does not have the flows dependencies installed (i.e. pandas in the example below).
Deployment:
Flow:
Additional context
Stack Trace from running with 2.19.7 and latest 3.x release: