From 6bec4ea13d7224c2101b2e5c46adc283c2946a1e Mon Sep 17 00:00:00 2001 From: diffy Date: Wed, 4 Mar 2026 12:04:50 +1000 Subject: [PATCH] python3Packages.srctools: use custom test script for pythoncapi-compat --- .../python-modules/srctools/default.nix | 17 +++++++++++------ .../python-modules/srctools/fix-tests.diff | 13 ------------- 2 files changed, 11 insertions(+), 19 deletions(-) delete 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 ad7adc5476b4..4199ce8c352c 100644 --- a/pkgs/development/python-modules/srctools/default.nix +++ b/pkgs/development/python-modules/srctools/default.nix @@ -11,6 +11,7 @@ pillow, pytest-regressions, dirty-equals, + setuptools, }: let pname = "srctools"; @@ -25,12 +26,6 @@ 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" @@ -52,8 +47,18 @@ buildPythonPackage { pillow pytest-regressions dirty-equals + setuptools # required for pythoncapi-compat tests ]; + # pythoncpai-comat tests are incompatible with pytest so we run their tests manually + # see https://github.com/python/pythoncapi-compat/pull/169 + disabledTestPaths = [ + "src/pythoncapi-compat" + ]; + postCheck = '' + python3 src/pythoncapi-compat/runtests.py --current + ''; + pythonImportsCheck = [ "srctools" ]; meta = { diff --git a/pkgs/development/python-modules/srctools/fix-tests.diff b/pkgs/development/python-modules/srctools/fix-tests.diff deleted file mode 100644 index 660da62df038..000000000000 --- a/pkgs/development/python-modules/srctools/fix-tests.diff +++ /dev/null @@ -1,13 +0,0 @@ -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