Hello, when creating prefect deployment with Pytho...
# ask-community
m
Hello, when creating prefect deployment with Python per the the docs it is:
Copy code
from prefect import flow

my_flow = flow.from_source(
    source="<https://github.com/PrefectHQ/prefect.git>",
    entrypoint="flows/hello_world.py:hello"
)

if __name__ == "__main__":
    my_flow()
What if my flow script is not in main branch but in a feature branch, is there a way to specify branch name? I know with prefect.yaml file, there is a way to specify this.
e
Hi @Moe 👋 check out the example here.
🙌 1
Copy code
from prefect.runner.storage import GitRepository
from prefect.blocks.system import Secret

    flow.from_source(
        source=GitRepository(
        url="<https://github.com/org/private-repo.git>",
        branch="dev",
    )
🙌 1
m
Hey @Emil Christensen thanks!
🙌 1
k
we use to deploy using prefect.yaml file instead of configuring inside python code. which has flexibility of deploying different versions of code and different env for testing.