Skip to content

Commit a90ca20

Browse files
authored
Full package (#2)
1 parent c7c7574 commit a90ca20

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,4 @@ setup:
2020

2121

2222
prefect-deploy: setup
23-
(cd src && uv run prefect deploy --prefect-file ../prefect.yaml --all)
24-
23+
uv run prefect deploy --prefect-file prefect.yaml --all

prefect.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,18 @@ pull:
2121
credentials: '{{ prefect.blocks.github-credentials.prefect-modal }}'
2222
- prefect.deployments.steps.run_shell_script:
2323
directory: '{{ clone-step.directory }}'
24-
script: |
25-
pip install --upgrade 'uv>=0.5.6,<0.6'
26-
/bin/sh -c "uv export --no-dev --no-editable --no-hashes --locked > requirements.txt"
27-
uv pip install --system -r requirements.txt
28-
- prefect.deployments.steps.set_working_directory:
29-
directory: '/{{ clone-step.directory }}/src'
24+
script: pip install uv==0.5.6
25+
- prefect.deployments.steps.run_shell_script:
26+
directory: '{{ clone-step.directory }}'
27+
script: uv sync --no-editable --extra workflows
3028

3129
# the deployments section allows you to provide configuration for deploying flows
3230
deployments:
3331
- name: prefect-modal-example
3432
version:
3533
tags: []
3634
description: Our first flow which runs on modal
37-
entrypoint: prefect_modal/flows/flow1.py:main
35+
entrypoint: prefect_modal.flows.flow1:main
3836
schedules:
3937
- cron: 0 12 * * *
4038
timezone: America/New_York
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
MY_VAR = 5

src/prefect_modal/flows/flow1.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from prefect import flow, task
2-
2+
from prefect_modal.flows.constants import MY_VAR
33

44
@task()
55
def do_print(param: str) -> None:
@@ -15,7 +15,7 @@ def run_my_flow(param: str) -> None:
1515

1616
@flow(log_prints=True)
1717
def main(name: str = "world", goodbye: bool = False):
18-
print(f"Hello {name} from Prefect! 🤗")
18+
print(f"Hello {name} from Prefect! 🤗. Your lucky number is {MY_VAR}")
1919
run_my_flow(name)
2020
if goodbye:
2121
print(f"Goodbye {name}!")

0 commit comments

Comments
 (0)