diff --git a/meta-python/recipes-devtools/python/python3-tomli-w/0001-pyproject.toml-allow-building-with-flit_core-4.patch b/meta-python/recipes-devtools/python/python3-tomli-w/0001-pyproject.toml-allow-building-with-flit_core-4.patch
new file mode 100644
index 0000000000..31eaf6c6d2
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-tomli-w/0001-pyproject.toml-allow-building-with-flit_core-4.patch
@@ -0,0 +1,23 @@
+From: Tim Orling <tim.orling@konsulko.com>
+Subject: [PATCH] pyproject.toml: allow building with flit_core 4
+
+flit_core 4 only drops features this project does not use (the
+[tool.flit.metadata] table, sdists from VCS and --setup-py), so
+raise the upper bound to <5, as the flit 4.0 release notes suggest:
+https://flit.pypa.io/en/stable/history.html#version-4-0
+
+Upstream-Status: Pending
+AI-Generated: Uses Claude Code (Claude Opus 5.5)
+Signed-off-by: Tim Orling <tim.orling@konsulko.com>
+---
+diff --git a/pyproject.toml b/pyproject.toml
+index edfdbf6..beb5355 100644
+--- a/pyproject.toml
++++ b/pyproject.toml
+@@ -1,5 +1,5 @@
+ [build-system]
+-requires = ["flit_core>=3.2.0,<4"]
++requires = ["flit_core>=3.2.0,<5"]
+ build-backend = "flit_core.buildapi"
+ 
+ [project]
diff --git a/meta-python/recipes-devtools/python/python3-tomli-w_1.2.0.bb b/meta-python/recipes-devtools/python/python3-tomli-w_1.2.0.bb
index ea364ae8f6..899fd7c35f 100644
--- a/meta-python/recipes-devtools/python/python3-tomli-w_1.2.0.bb
+++ b/meta-python/recipes-devtools/python/python3-tomli-w_1.2.0.bb
@@ -6,6 +6,8 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=aaaaf0879d17df0110d1aa8c8c9f46f5"
 SRCREV = "a8f80172ba16fe694e37f6e07e6352ecee384c58"
 PYPI_SRC_URI = "git://github.com/hukkin/tomli-w.git;protocol=https;branch=master;destsuffix=${S}"
 
+SRC_URI += "file://0001-pyproject.toml-allow-building-with-flit_core-4.patch"
+
 inherit pypi python_flit_core ptest-python-pytest
 
 
