From 56418396999f28b16be45da7a069ff424c31ca4b Mon Sep 17 00:00:00 2001 From: Pyrox Date: Mon, 29 Jul 2024 00:23:41 -0400 Subject: [PATCH 1/2] python312Packages.inotify: drop nose dependency --- .../python-modules/inotify/default.nix | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/inotify/default.nix b/pkgs/development/python-modules/inotify/default.nix index 6e8e7f0aba67..874bdd4550f3 100644 --- a/pkgs/development/python-modules/inotify/default.nix +++ b/pkgs/development/python-modules/inotify/default.nix @@ -2,7 +2,7 @@ lib, buildPythonPackage, fetchFromGitHub, - nose, + pytestCheckHook, }: buildPythonPackage rec { @@ -18,10 +18,21 @@ buildPythonPackage rec { fetchSubmodules = false; }; - nativeCheckInputs = [ nose ]; + postPatch = '' + # Needed because assertEquals was removed in python 3.12 + substituteInPlace tests/test_inotify.py \ + --replace-fail "assertEquals" "assertEqual" \ + ''; - # dunno what's wrong but the module works regardless - doCheck = false; + nativeCheckInputs = [ pytestCheckHook ]; + + # Disable these tests as they're flaky. + # The returned list can be in a different order, which causes the tests to fail. + disabledTests = [ + "test__automatic_new_watches_on_new_paths" + "test__cycle" + "test__renames" + ]; meta = with lib; { homepage = "https://github.com/dsoprea/PyInotify"; From 96eb0d2cba97a76c482bc3937ec9871eb80f395d Mon Sep 17 00:00:00 2001 From: Pyrox Date: Mon, 29 Jul 2024 00:25:26 -0400 Subject: [PATCH 2/2] python312Packages.inotify: modernize --- .../python-modules/inotify/default.nix | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/inotify/default.nix b/pkgs/development/python-modules/inotify/default.nix index 874bdd4550f3..b5e3fd5acff8 100644 --- a/pkgs/development/python-modules/inotify/default.nix +++ b/pkgs/development/python-modules/inotify/default.nix @@ -3,19 +3,19 @@ buildPythonPackage, fetchFromGitHub, pytestCheckHook, + setuptools, }: -buildPythonPackage rec { +buildPythonPackage { pname = "inotify"; version = "unstable-2020-08-27"; - format = "setuptools"; + pyproject = true; src = fetchFromGitHub { owner = "dsoprea"; repo = "PyInotify"; rev = "f77596ae965e47124f38d7bd6587365924dcd8f7"; - sha256 = "X0gu4s1R/Kg+tmf6s8SdZBab2HisJl4FxfdwKktubVc="; - fetchSubmodules = false; + hash = "sha256-X0gu4s1R/Kg+tmf6s8SdZBab2HisJl4FxfdwKktubVc="; }; postPatch = '' @@ -24,6 +24,8 @@ buildPythonPackage rec { --replace-fail "assertEquals" "assertEqual" \ ''; + build-system = [ setuptools ]; + nativeCheckInputs = [ pytestCheckHook ]; # Disable these tests as they're flaky. @@ -34,10 +36,10 @@ buildPythonPackage rec { "test__renames" ]; - meta = with lib; { + meta = { homepage = "https://github.com/dsoprea/PyInotify"; description = "Monitor filesystems events on Linux platforms with inotify"; - license = licenses.gpl2; - platforms = platforms.linux; + license = lib.licenses.gpl2; + platforms = lib.platforms.linux; }; }