From 8b34e94b93003631e60df62192959beb88ce8178 Mon Sep 17 00:00:00 2001 From: Sigmanificient Date: Sun, 28 Jul 2024 19:48:54 +0200 Subject: [PATCH] python312Packages.pycdio: drop nose dependency --- .../python-modules/pycdio/default.nix | 42 ++++++++++++------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/pkgs/development/python-modules/pycdio/default.nix b/pkgs/development/python-modules/pycdio/default.nix index 78a620eb0dd76d3..7be0e1ea873fe88 100644 --- a/pkgs/development/python-modules/pycdio/default.nix +++ b/pkgs/development/python-modules/pycdio/default.nix @@ -4,14 +4,17 @@ buildPythonPackage, fetchPypi, setuptools, - nose, - pkgs, + pkg-config, + swig, + libcdio, + libiconv, + pytestCheckHook, }: buildPythonPackage rec { pname = "pycdio"; version = "2.1.1"; - format = "setuptools"; + pyproject = true; src = fetchPypi { inherit pname version; @@ -29,23 +32,32 @@ buildPythonPackage rec { patchShebangs . ''; + build-system = [ setuptools ]; + nativeBuildInputs = [ - nose - pkgs.pkg-config - pkgs.swig + pkg-config + swig ]; + buildInputs = [ - setuptools - pkgs.libcdio - ] ++ lib.optional stdenv.isDarwin pkgs.libiconv; - - # Run tests using nosetests but first need to install the binaries - # to the root source directory where they can be found. - checkPhase = '' - ./setup.py install_lib -d . - nosetests + libcdio + libiconv + ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + preCheck = '' + substituteInPlace test/test-cdtext.py \ + --replace-fail "assertEquals" "assertEqual" ''; + pytestFlagsArray = [ + "test/test-cdio.py" + "test/test-cdtext.py" + "test/test-iso.py" + "test/test-isocopy.py" + ]; + meta = with lib; { homepage = "https://www.gnu.org/software/libcdio/"; description = "Wrapper around libcdio (CD Input and Control library)";