From 27668c34c63b19578a3503200a09248c1547541e Mon Sep 17 00:00:00 2001 From: diffy Date: Wed, 25 Feb 2026 07:30:06 +1000 Subject: [PATCH] python3Packages.srctools: relax meson-python dependency & fix pythoncapi-compat test failure Patched for https://github.com/python/pythoncapi-compat/pull/169 --- .../development/python-modules/srctools/default.nix | 11 +++++++++++ .../python-modules/srctools/fix-tests.diff | 13 +++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 pkgs/development/python-modules/srctools/fix-tests.diff diff --git a/pkgs/development/python-modules/srctools/default.nix b/pkgs/development/python-modules/srctools/default.nix index 3d5b242aef70..ad7adc5476b4 100644 --- a/pkgs/development/python-modules/srctools/default.nix +++ b/pkgs/development/python-modules/srctools/default.nix @@ -25,6 +25,17 @@ buildPythonPackage { hash = "sha256-c+NmrTntpNTEI782aoC4bNpoKpWe4cqSAkxpYS5HH30="; }; + # TODO remove when https://github.com/python/pythoncapi-compat/pull/169 is merged + # and new srctools version is released with fix + patches = [ + ./fix-tests.diff + ]; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail "meson-python == 0.18.0" "meson-python >= 0.18.0" + ''; + build-system = [ meson meson-python diff --git a/pkgs/development/python-modules/srctools/fix-tests.diff b/pkgs/development/python-modules/srctools/fix-tests.diff new file mode 100644 index 000000000000..660da62df038 --- /dev/null +++ b/pkgs/development/python-modules/srctools/fix-tests.diff @@ -0,0 +1,13 @@ +diff --git a/src/pythoncapi-compat/tests/test_pythoncapi_compat.py b/src/pythoncapi-compat/tests/test_pythoncapi_compat.py +index 8480415..4137489 100644 +--- a/src/pythoncapi-compat/tests/test_pythoncapi_compat.py ++++ b/src/pythoncapi-compat/tests/test_pythoncapi_compat.py +@@ -21,7 +21,7 @@ except ImportError: + faulthandler = None + + # test.utils +-from utils import run_command, command_stdout ++from .utils import run_command, command_stdout + + + # Windows uses MSVC compiler \ No newline at end of file