my prefect server setup prefect-metrics.waow.tech
python orchestration
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: inject .venv site-packages into sys.path for k8s flow pods

uv sync in the pull step creates .venv/ with duckdb/prefect-dbt, but
system python doesn't see it. bootstrap sys.path at top of each flow
file before any imports.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

zzstoatzz bd729e5d 00abe8d9

+16
+8
flows/enrich.py
··· 1 + # k8s: prefect uses system python, but uv sync in the pull step creates .venv/ 2 + # with extra deps (duckdb, prefect-dbt, etc). inject it into sys.path before any imports. 3 + import sys as _sys 4 + from pathlib import Path as _Path 5 + _site = _Path(__file__).parent.parent / ".venv" / "lib" / f"python{_sys.version_info.major}.{_sys.version_info.minor}" / "site-packages" 6 + if _site.exists() and str(_site) not in _sys.path: 7 + _sys.path.insert(0, str(_site)) 8 + 1 9 import subprocess 2 10 from datetime import timedelta 3 11 from pathlib import Path
+8
flows/gh_notifications.py
··· 11 11 (set in the work pool base job template or via deploy/results-pvc.yaml) 12 12 """ 13 13 14 + # k8s: prefect uses system python, but uv sync in the pull step creates .venv/ 15 + # with extra deps (duckdb, etc). inject it into sys.path before any imports. 16 + import sys as _sys 17 + from pathlib import Path as _Path 18 + _site = _Path(__file__).parent.parent / ".venv" / "lib" / f"python{_sys.version_info.major}.{_sys.version_info.minor}" / "site-packages" 19 + if _site.exists() and str(_site) not in _sys.path: 20 + _sys.path.insert(0, str(_site)) 21 + 14 22 import datetime 15 23 import os 16 24 from dataclasses import dataclass