William Jamir05/18/2022, 9:04 PM
Which is registered with:
with Flow(...) as flow: x = Parameter(...) ...
But now I dont want to have this flow as a global variable, because my tests need to do some settings before and I dont want to trigger any of the code within this context manager. I can easily move this to a function, and make it return the flow instance, but I dont know how to deal with the registration by command line. I mean, its possible to still use the register by command line, or do I need to make it now programmatically? Basically, I’m looking for a solution like this:
prefect register -p flows/my_file.py --project "MyProject"
def main(): with Flow(...) as flow: x = Parameter(...) ... return flow
prefect register -p flows/my_file.py:main --project "MyProject"
instead and add flow.register() or call your function there?
if __name__ == __main__