From 28210b02fe7b689565fb56237e125c3a28706a71 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 25 Jan 2026 02:07:29 +0100 Subject: [PATCH] python3Packages.readchar: fix pytest 9 compat --- .../python-modules/readchar/default.nix | 3 ++ .../readchar/pytest9-compat.patch | 39 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 pkgs/development/python-modules/readchar/pytest9-compat.patch diff --git a/pkgs/development/python-modules/readchar/default.nix b/pkgs/development/python-modules/readchar/default.nix index 1e21838fdc2d..1fb0049f76e9 100644 --- a/pkgs/development/python-modules/readchar/default.nix +++ b/pkgs/development/python-modules/readchar/default.nix @@ -25,6 +25,9 @@ buildPythonPackage rec { hash = "sha256-r+dKGv0a7AU+Ef94AGCCJLQolLqTTxaNmqRQYkxk15s="; }; + # https://github.com/magmax/python-readchar/pull/129 + patches = [ ./pytest9-compat.patch ]; + postPatch = '' # Tags on GitHub still have a postfix (-dev0) sed -i 's/\(version = "\)[^"]*\(".*\)/\1${version}\2/' pyproject.toml diff --git a/pkgs/development/python-modules/readchar/pytest9-compat.patch b/pkgs/development/python-modules/readchar/pytest9-compat.patch new file mode 100644 index 000000000000..4641eb82f604 --- /dev/null +++ b/pkgs/development/python-modules/readchar/pytest9-compat.patch @@ -0,0 +1,39 @@ +From 5165992002f211fe85175bcbb4f9a60d5e90fdac Mon Sep 17 00:00:00 2001 +From: Martin Weinelt +Date: Sun, 25 Jan 2026 02:05:23 +0100 +Subject: [PATCH] Fix pytest 9 compatibility + +The path argument has been deprecated in favor of the collection_path +argument beecause the former uses the deprecated py library, where the +latter uses pathlib. +--- + tests/linux/conftest.py | 2 +- + tests/windows/conftest.py | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/linux/conftest.py b/tests/linux/conftest.py +index 038203f..3283724 100644 +--- a/tests/linux/conftest.py ++++ b/tests/linux/conftest.py +@@ -8,7 +8,7 @@ + + + # ignore all tests in this folder if not on linux +-def pytest_ignore_collect(path, config): ++def pytest_ignore_collect(collection_path, config): + if not sys.platform.startswith("linux"): + return True + +diff --git a/tests/windows/conftest.py b/tests/windows/conftest.py +index 492d7d7..e0264e8 100644 +--- a/tests/windows/conftest.py ++++ b/tests/windows/conftest.py +@@ -4,7 +4,7 @@ + + + # ignore all tests in this folder if not on windows +-def pytest_ignore_collect(path, config): ++def pytest_ignore_collect(collection_path, config): + if sys.platform not in ("win32", "cygwin"): + return True +