From a0fe0bf949ae5cb557708b5769c0460fe7741af7 Mon Sep 17 00:00:00 2001 From: Sigmanificient Date: Sat, 27 Jul 2024 04:53:13 +0200 Subject: [PATCH] python312Packages.changefinder: drop nose dependency --- .../python-modules/changefinder/default.nix | 16 ++++++++++------ .../changefinder/fix_test_invocation.patch | 13 +++++++++++++ 2 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 pkgs/development/python-modules/changefinder/fix_test_invocation.patch diff --git a/pkgs/development/python-modules/changefinder/default.nix b/pkgs/development/python-modules/changefinder/default.nix index fc34238f00ec..4405fa8a8525 100644 --- a/pkgs/development/python-modules/changefinder/default.nix +++ b/pkgs/development/python-modules/changefinder/default.nix @@ -2,7 +2,7 @@ , buildPythonPackage , fetchFromGitHub , setuptools -, nose +, pytestCheckHook , numpy , scipy , statsmodels @@ -20,17 +20,21 @@ buildPythonPackage { hash = "sha256-1If0gIsMU8673fKSSHVMvDgR1UnYgM/4HiyvZJ9T6VM="; }; - nativeBuildInputs = [ - setuptools - ]; + patches = [ ./fix_test_invocation.patch ]; - propagatedBuildInputs = [ - nose # not actually required during runtime, but specified as required in `setup.py` + build-system = [ setuptools ]; + + pythonRemoveDeps = [ "nose" ]; + + dependencies = [ numpy scipy statsmodels ]; + nativeCheckInputs = [ pytestCheckHook ]; + pytestFlagsArray = [ "test/test.py" ]; + pythonImportsCheck = [ "changefinder" ]; meta = with lib; { diff --git a/pkgs/development/python-modules/changefinder/fix_test_invocation.patch b/pkgs/development/python-modules/changefinder/fix_test_invocation.patch new file mode 100644 index 000000000000..f02e2e36d4b5 --- /dev/null +++ b/pkgs/development/python-modules/changefinder/fix_test_invocation.patch @@ -0,0 +1,13 @@ +diff --git a/test/test.py b/test/test.py +index 85a9f4e..a5f44fd 100644 +--- a/test/test.py ++++ b/test/test.py +@@ -4,7 +4,7 @@ import numpy as np + + + class TestChangeFinder(): +- def setup(self): ++ def setup_method(self): + self._term = 30 + self._smooth = 7 + self._order = 1