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 9a85faa9c55 Fix provider distribution builds failing with flit 4 
(#71118)
9a85faa9c55 is described below

commit 9a85faa9c55b907bd105ee41567bb7d55dab9f31
Author: rjgoyln <[email protected]>
AuthorDate: Wed Aug 5 13:43:59 2026 +0800

    Fix provider distribution builds failing with flit 4 (#71118)
    
    * Fix provider distribution builds failing with flit 4
    
    flit 4.0 removed the --setup-py/--no-setup-py options, so every flit-backed
    provider build now aborts during argument parsing as soon as flit 4 
resolves.
    Not generating setup.py has been flit's default since well before the 3.12
    floor breeze requires, so no longer asking for it explicitly leaves the 
built
    distributions unchanged.
    
    * Cap flit below 4 so provider distributions keep valid metadata
    
    `flit build` does not use PEP 517 build isolation, so whichever flit_core is
    installed becomes the backend for every provider distribution and the
    `flit_core==3.12.0` pin each provider declares never applies on the path we
    release from. flit_core 4.0.1 writes Import-Name and Import-Namespace 
without a
    trailing newline (https://github.com/pypa/flit/issues/813), consuming the 
blank
    line that separates the metadata headers from the description, so the 
resulting
    METADATA parses with MissingHeaderBodySeparatorDefect.
    
    Removal of the cap is tracked at
    https://github.com/apache/airflow/issues/71121.
    
    * Drop the flit flag regression test
    
    The assertion mirrors the argv literal it guards and mocks away the argument
    parser that actually rejected the flag, so it detects reverts rather than 
the
    class of breakage it was written for. The provider distribution build jobs
    cover that.
    
    * Rest the flit cap on the unvalidated backend rather than the 4.0.1 defect
    
    flit 4.0.2 fixed the METADATA corruption the comment cited, but the reason 
to
    hold the backend at 3.12.0 is that nothing has exercised flit 4 against 
provider
    distributions or the reproducible-build checks.
    
    ---------
    
    Co-authored-by: Rahul Vats <[email protected]>
---
 dev/breeze/pyproject.toml                                         | 8 ++++++--
 .../airflow_breeze/prepare_providers/provider_distributions.py    | 2 +-
 dev/breeze/uv.lock                                                | 4 ++--
 uv.lock                                                           | 6 +++---
 4 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/dev/breeze/pyproject.toml b/dev/breeze/pyproject.toml
index ccbd0e10727..4ab83e79010 100644
--- a/dev/breeze/pyproject.toml
+++ b/dev/breeze/pyproject.toml
@@ -47,8 +47,12 @@ dependencies = [
     "black>=26.1.0",
     "click>=8.3.0",
     "filelock>=3.13.0",
-    "flit>=3.12.0",
-    "flit-core>=3.12.0",
+    # Capped below 4 because `flit build` has no PEP 517 isolation: the 
installed flit_core is
+    # what builds every provider distribution, so the `flit_core==` pin they 
declare never
+    # applies. Adopting the 4.x backend is tracked at
+    # https://github.com/apache/airflow/issues/71121
+    "flit>=3.12.0,<4",
+    "flit-core>=3.12.0,<4",
     "google-api-python-client>=2.142.0",
     "google-auth-httplib2>=0.2.0",
     "google-auth-oauthlib>=1.2.0",
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 ff4ce0b0a03..459b66a013c 100644
--- a/dev/breeze/src/airflow_breeze/prepare_providers/provider_distributions.py
+++ b/dev/breeze/src/airflow_breeze/prepare_providers/provider_distributions.py
@@ -251,7 +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":
-        command: list[str] = [sys.executable, "-m", "flit", "build", 
"--no-setup-py", "--use-vcs"]
+        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/uv.lock b/dev/breeze/uv.lock
index 94929797888..ff75e90f6ca 100644
--- a/dev/breeze/uv.lock
+++ b/dev/breeze/uv.lock
@@ -69,8 +69,8 @@ requires-dist = [
     { name = "boto3", specifier = ">=1.37.2" },
     { name = "click", specifier = ">=8.3.0" },
     { name = "filelock", specifier = ">=3.13.0" },
-    { name = "flit", specifier = ">=3.12.0" },
-    { name = "flit-core", specifier = ">=3.12.0" },
+    { name = "flit", specifier = ">=3.12.0,<4" },
+    { name = "flit-core", specifier = ">=3.12.0,<4" },
     { name = "gitpython", specifier = ">=3.1.40" },
     { name = "google-api-python-client", specifier = ">=2.142.0" },
     { name = "google-auth-httplib2", specifier = ">=0.2.0" },
diff --git a/uv.lock b/uv.lock
index 9321fb52ec7..f039ed5c273 100644
--- a/uv.lock
+++ b/uv.lock
@@ -64,9 +64,9 @@ apache-airflow-providers-apache-cassandra = false
 apache-airflow-providers-asana = false
 apache-airflow-providers-oracle = false
 apache-airflow-providers-mysql = false
-apache-airflow-providers-teradata = false
 apache-airflow-providers-alibaba = false
 apache-airflow-providers-microsoft-mssql = false
+apache-airflow-providers-teradata = false
 apache-airflow-providers-jdbc = false
 apache-airflow-helm-chart = false
 apache-airflow-providers-anthropic = false
@@ -1901,8 +1901,8 @@ requires-dist = [
     { name = "boto3", specifier = ">=1.37.2" },
     { name = "click", specifier = ">=8.3.0" },
     { name = "filelock", specifier = ">=3.13.0" },
-    { name = "flit", specifier = ">=3.12.0" },
-    { name = "flit-core", specifier = ">=3.12.0" },
+    { name = "flit", specifier = ">=3.12.0,<4" },
+    { name = "flit-core", specifier = ">=3.12.0,<4" },
     { name = "gitpython", specifier = ">=3.1.40" },
     { name = "google-api-python-client", specifier = ">=2.142.0" },
     { name = "google-auth-httplib2", specifier = ">=0.2.0" },

Reply via email to