https://prefect.io logo
Title
j

Joe

09/29/2022, 7:39 PM
Prefect 1.0 -> 2.0 Question: Is there a reason that
Deployment.build_from_flow
requires a
.prefectignore
file? Currently have all of those flows in a pip installable python module, would be nice to be able to override that rather than need to skip upload in the build, and then separate calls to
apply()
and
upload_to_storage(...)
.
I could treat the package in python like any other directory (since it's always a source dist) but it seems like a bad practice.
Probably this is part of what pickling the flows previously was circumventing
a

Anna Geller

09/29/2022, 11:33 PM
Prefectignore file is an important concept to guard against uploading code you may not want to get uploaded to remote storage. Of you don't create it, Prefect will generate that for you automatically
j

Joe

09/30/2022, 4:51 PM
Not if you're only using the
build_from_flow
. If you work through the tutorial at https://docs.prefect.io/tutorials/deployments/#deployment-creation-with-python but don't bother doing the CLI - the file doesn't exist in the directory and isn't mentioned as a requirement - the
prefect deployment build
command auto-generates the file where the python api does not.
1
You can be precise with the API (presumably) so uploading the planet shouldn't be a concern at that point.