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 d98263b20af Add uv sync --no-dev before provider YAML checks (#60728)
d98263b20af is described below

commit d98263b20af93d52cb9002d743c3d8d7b641ebf0
Author: Dhananjay Gupta <[email protected]>
AuthorDate: Thu Mar 12 01:16:52 2026 +0530

    Add uv sync --no-dev before provider YAML checks (#60728)
    
    * Add sync_dependencies_without_dev() and call it before provider checks
    
    * Add uv sync --no-dev before provider YAML checks
    
    - Add sync_dependencies_without_dev() to strip dev dependencies
    - Move jsonpath_ng import inside function to avoid ImportError
    - Helps detect unhandled optional cross-provider dependencies
    
    Related: #60662
    
    * Change uv sync failure handling from warning to exit
    
    - Exit immediately if uv sync --no-dev fails instead of continuing with 
warning
    - Add stdout display for better visibility of sync operation
    - Ensures validation never runs with dev dependencies present
    
    * Add sync_dependencies_without_dev() and call it before provider checks
    
    * ixes subprocess.run to include explicit check=False
    
    * ran perk --all-files
---
 .../in_container/run_provider_yaml_files_check.py  | 27 ++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/scripts/in_container/run_provider_yaml_files_check.py 
b/scripts/in_container/run_provider_yaml_files_check.py
index 17fbf527c61..138d640fd1d 100755
--- a/scripts/in_container/run_provider_yaml_files_check.py
+++ b/scripts/in_container/run_provider_yaml_files_check.py
@@ -25,6 +25,7 @@ import json
 import os
 import pathlib
 import platform
+import subprocess
 import sys
 import textwrap
 import warnings
@@ -98,6 +99,31 @@ suspended_logos: set[str] = set()
 suspended_integrations: set[str] = set()
 
 
+def sync_dependencies_without_dev() -> None:
+    """
+    Run uv sync --no-dev to strip development dependencies.
+
+    This ensures validation runs in an environment closer to production,
+    which helps detect cases where providers have unhandled optional
+    cross-provider dependencies.
+    """
+    console.print("[magenta]Running uv sync --no-dev to strip development 
dependencies...[/]")
+    result = subprocess.run(
+        ["uv", "sync", "--no-dev", "--all-packages", "--no-python-downloads", 
"--no-managed-python"],
+        capture_output=True,
+        text=True,
+        cwd=AIRFLOW_ROOT_PATH,
+        check=False,
+    )
+    if result.returncode != 0:
+        console.print(f"[red]Failed to remove dev dependencies: 
{result.stderr}[/]")
+        sys.exit(1)
+
+    console.print("[green]Successfully synchronized without dev 
dependencies[/]")
+    if result.stdout:
+        console.print(result.stdout)
+
+
 def _filepath_to_module(filepath: pathlib.Path | str) -> str:
     if isinstance(filepath, str):
         filepath = pathlib.Path(filepath)
@@ -723,6 +749,7 @@ def 
check_providers_have_all_documentation_files(yaml_files: dict[str, dict]):
 
 
 if __name__ == "__main__":
+    sync_dependencies_without_dev()
     ProvidersManager().initialize_providers_configuration()
     architecture = Architecture.get_current()
     console.print(f"Verifying packages on {architecture} architecture. 
Platform: {platform.machine()}.")

Reply via email to