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

ashb 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 32df1795022 Stop flit from downloading and verifying trove classifiers 
on every provider (#73612)
32df1795022 is described below

commit 32df17950229a611ad1d90f72da3b36912a3caa7
Author: Ash Berlin-Taylor <[email protected]>
AuthorDate: Wed Sep 23 15:01:46 2026 +0100

    Stop flit from downloading and verifying trove classifiers on every 
provider (#73612)
    
    PyPI was returning some 503's for this today causing CI to fail. To all
    intents and purposes, the PyPI trove classifiers don't change in a way
    that affects us, so making a (number) of network requests to check them
    is unnecessary.
---
 .../prepare_providers/provider_distributions.py    |  1 +
 dev/breeze/tests/test_provider_distributions.py    | 32 ++++++++++++++++++++++
 2 files changed, 33 insertions(+)

diff --git 
a/dev/breeze/src/airflow_breeze/prepare_providers/provider_distributions.py 
b/dev/breeze/src/airflow_breeze/prepare_providers/provider_distributions.py
index 459b66a013c..400fbaad285 100644
--- a/dev/breeze/src/airflow_breeze/prepare_providers/provider_distributions.py
+++ b/dev/breeze/src/airflow_breeze/prepare_providers/provider_distributions.py
@@ -251,6 +251,7 @@ def build_provider_distribution(
     build_backend = provider_info.get("build-system", "flit_core")
     build_env = {"SOURCE_DATE_EPOCH": 
str(get_provider_details(provider_id).source_date_epoch)}
     if build_backend == "flit_core":
+        build_env["FLIT_NO_NETWORK"] = "1"
         command: list[str] = [sys.executable, "-m", "flit", "build", 
"--use-vcs"]
         console_print(
             "[warning]Workaround wheel-only package bug in flit by building 
both and removing sdist."
diff --git a/dev/breeze/tests/test_provider_distributions.py 
b/dev/breeze/tests/test_provider_distributions.py
index 96ef113471c..6b4fa33a45d 100644
--- a/dev/breeze/tests/test_provider_distributions.py
+++ b/dev/breeze/tests/test_provider_distributions.py
@@ -17,6 +17,8 @@
 from __future__ import annotations
 
 import re
+import subprocess
+import sys
 from pathlib import Path
 from unittest.mock import patch
 
@@ -125,3 +127,33 @@ def 
test_plain_checkout_allows_all_formats(plain_checkout_root: Path) -> None:
         check_flit_worktree_compatibility("sdist")
         check_flit_worktree_compatibility("both")
         check_flit_worktree_compatibility("wheel")
+
+
[email protected]("distribution_format", ["wheel", "sdist", "both"])
[email protected]("build_fails", [False, True])
+def test_flit_provider_build_disables_network(tmp_path: Path, 
distribution_format: str, build_fails: bool):
+    with (
+        patch.object(
+            provider_distributions, "get_provider_distributions_metadata", 
autospec=True
+        ) as metadata,
+        patch.object(provider_distributions, "get_provider_details", 
autospec=True) as details,
+        patch.object(provider_distributions, "run_command", autospec=True) as 
run_command,
+    ):
+        metadata.return_value = {"duckdb": {"build-system": "flit_core"}}
+        details.return_value.source_date_epoch = 1788600000
+        if build_fails:
+            run_command.side_effect = subprocess.CalledProcessError(1, "flit")
+            with 
pytest.raises(provider_distributions.PrepareReleasePackageErrorBuildingPackageException):
+                provider_distributions.build_provider_distribution("duckdb", 
tmp_path, distribution_format)
+        else:
+            provider_distributions.build_provider_distribution("duckdb", 
tmp_path, distribution_format)
+
+    command = [sys.executable, "-m", "flit", "build", "--use-vcs"]
+    if distribution_format == "sdist":
+        command.extend(["--format", "sdist"])
+    run_command.assert_called_once_with(
+        command,
+        check=True,
+        cwd=tmp_path,
+        env={"SOURCE_DATE_EPOCH": "1788600000", "FLIT_NO_NETWORK": "1"},
+    )

Reply via email to