Skip to content

Commit 9a85faa

Browse files
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 (pypa/flit#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 #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]>
1 parent f69c195 commit 9a85faa

4 files changed

Lines changed: 12 additions & 8 deletions

File tree

‎dev/breeze/pyproject.toml‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,12 @@ dependencies = [
4747
"black>=26.1.0",
4848
"click>=8.3.0",
4949
"filelock>=3.13.0",
50-
"flit>=3.12.0",
51-
"flit-core>=3.12.0",
50+
# Capped below 4 because `flit build` has no PEP 517 isolation: the installed flit_core is
51+
# what builds every provider distribution, so the `flit_core==` pin they declare never
52+
# applies. Adopting the 4.x backend is tracked at
53+
# https://github.com/apache/airflow/issues/71121
54+
"flit>=3.12.0,<4",
55+
"flit-core>=3.12.0,<4",
5256
"google-api-python-client>=2.142.0",
5357
"google-auth-httplib2>=0.2.0",
5458
"google-auth-oauthlib>=1.2.0",

‎dev/breeze/src/airflow_breeze/prepare_providers/provider_distributions.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ def build_provider_distribution(
251251
build_backend = provider_info.get("build-system", "flit_core")
252252
build_env = {"SOURCE_DATE_EPOCH": str(get_provider_details(provider_id).source_date_epoch)}
253253
if build_backend == "flit_core":
254-
command: list[str] = [sys.executable, "-m", "flit", "build", "--no-setup-py", "--use-vcs"]
254+
command: list[str] = [sys.executable, "-m", "flit", "build", "--use-vcs"]
255255
console_print(
256256
"[warning]Workaround wheel-only package bug in flit by building both and removing sdist."
257257
)

‎dev/breeze/uv.lock‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎uv.lock‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)