This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new d2a8457e768 Run the lang-SDK conformance serializer in its own 
virtualenv (#75085)
d2a8457e768 is described below

commit d2a8457e768e1d4ac5b1dd52ba330945c0174d0d
Author: Jarek Potiuk <[email protected]>
AuthorDate: Mon Oct 19 16:55:26 2026 +0200

    Run the lang-SDK conformance serializer in its own virtualenv (#75085)
    
    The Python side of the SDK serialization conformance checks ran in the
    workspace .venv. prek runs the chart's kubeconform hook at the same time,
    and it syncs that .venv to the kubernetes-tests packages through
    `breeze k8s setup-env`. When the cncf.kubernetes provider landed there
    after the serializer's Python had started, provider discovery found the
    provider's entry point but not its sources on sys.path, and the check
    failed with "No module named 'airflow.providers.cncf'".
    
    Point uv at a dedicated .build/lang-sdk-serialization-venv instead.
    
    Generated-by: Claude Opus 5
---
 scripts/ci/lang_sdk_serialization/compare.py | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/scripts/ci/lang_sdk_serialization/compare.py 
b/scripts/ci/lang_sdk_serialization/compare.py
index e6fbab441c8..ecb27acb733 100644
--- a/scripts/ci/lang_sdk_serialization/compare.py
+++ b/scripts/ci/lang_sdk_serialization/compare.py
@@ -45,6 +45,7 @@ from __future__ import annotations
 
 import argparse
 import json
+import os
 import re
 import shutil
 import subprocess
@@ -57,6 +58,11 @@ HERE = Path(__file__).resolve().parent
 REPO_ROOT = HERE.parents[2]
 TEST_DAGS = HERE / "test_dags.yaml"
 SCHEMA = REPO_ROOT / "airflow-core" / "src" / "airflow" / "serialization" / 
"schema.json"
+# Not the workspace's .venv: prek runs other projects' hooks at the same time, 
and some of them sync
+# that .venv to another set of packages (the chart's kubeconform hook installs 
the cncf.kubernetes
+# provider there through `breeze k8s setup-env`). A provider that lands there 
after Python started
+# has its entry point found but its sources off sys.path, and loading the 
config then fails.
+PYTHON_SERIALIZER_VENV = REPO_ROOT / ".build" / "lang-sdk-serialization-venv"
 
 # The features that a Dag of test_dags.yaml may require of an SDK. The comment 
at the top of
 # test_dags.yaml says what each one adds to a Dag.
@@ -139,8 +145,8 @@ def filter_cases(text: str, supported: frozenset[str]) -> 
tuple[str, list[str]]:
     return "".join(kept), ids
 
 
-def run(command: list[str]) -> None:
-    if subprocess.run(command, cwd=REPO_ROOT, check=False).returncode:
+def run(command: list[str], env: dict[str, str] | None = None) -> None:
+    if subprocess.run(command, cwd=REPO_ROOT, check=False, env=env).returncode:
         raise SystemExit(f"`{' '.join(command)}` failed")
 
 
@@ -297,7 +303,8 @@ def main(argv: list[str] | None = None) -> int:
             "--receive",
             str(sdk_output),
             str(received_output),
-        ]
+        ],
+        env={**os.environ, "UV_PROJECT_ENVIRONMENT": 
str(PYTHON_SERIALIZER_VENV)},
     )
 
     python = json.loads(python_output.read_text())

Reply via email to