Skip to content

Commit 6879591

Browse files
baogorekclaude
andcommitted
Fix coordinate_publish: use uv run subprocess for policyengine_us_data import
The direct import failed because Modal's system Python doesn't have the package — it's installed in the uv venv. Matches the subprocess pattern used by all other policyengine_us_data imports in this file. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8197510 commit 6879591

1 file changed

Lines changed: 19 additions & 6 deletions

File tree

modal_app/local_area.py

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -674,13 +674,26 @@ def coordinate_publish(
674674
validate_artifacts(config_json_path, artifacts)
675675

676676
# Fingerprint-based cache invalidation
677-
from policyengine_us_data.calibration.publish_local_area import (
678-
compute_input_fingerprint,
679-
)
680-
681-
fingerprint = compute_input_fingerprint(
682-
weights_path, dataset_path, n_clones, seed=42
677+
fp_result = subprocess.run(
678+
[
679+
"uv",
680+
"run",
681+
"python",
682+
"-c",
683+
f"""
684+
from policyengine_us_data.calibration.publish_local_area import (
685+
compute_input_fingerprint,
686+
)
687+
print(compute_input_fingerprint("{weights_path}", "{dataset_path}", {n_clones}, seed=42))
688+
""",
689+
],
690+
capture_output=True,
691+
text=True,
692+
env=os.environ.copy(),
683693
)
694+
if fp_result.returncode != 0:
695+
raise RuntimeError(f"Failed to compute fingerprint: {fp_result.stderr}")
696+
fingerprint = fp_result.stdout.strip()
684697
fingerprint_file = version_dir / "fingerprint.json"
685698
if version_dir.exists():
686699
if fingerprint_file.exists():

0 commit comments

Comments
 (0)