From 755adaaeb529ee2de163a3129ecac4298fd1f99e Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 3 Mar 2023 18:52:39 +0100 Subject: [PATCH] python310Packages.multiset: Fix build The package has a broken python_requires version specifier, that breaks the build with newer setuptools versions. Convert the package to pep517 build, migrate the fetcher to an SRI hash, and explicitly enable tests. --- .../python-modules/multiset/default.nix | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/multiset/default.nix b/pkgs/development/python-modules/multiset/default.nix index bebd6a73e702..a64a3e928c80 100644 --- a/pkgs/development/python-modules/multiset/default.nix +++ b/pkgs/development/python-modules/multiset/default.nix @@ -1,22 +1,38 @@ { lib , buildPythonPackage , fetchPypi +, setuptools , setuptools-scm -, pytest-runner -, pytest +, pytestCheckHook }: buildPythonPackage rec { pname = "multiset"; version = "3.0.1"; + format = "pyproject"; src = fetchPypi { inherit pname version; - sha256 = "e45671cae8385a8e6248a9b07a3a83280c2d0cc4312713058cfbacdc5ec9973e"; + hash = "sha256-5FZxyug4Wo5iSKmwejqDKAwtDMQxJxMFjPus3F7Jlz4="; }; - buildInputs = [ setuptools-scm pytest-runner ]; - nativeCheckInputs = [ pytest ]; + nativeBuildInputs = [ + setuptools + setuptools-scm + ]; + + postPatch = '' + # Drop broken version specifier + sed -i '/python_requires/d' setup.cfg + ''; + + pythonImportsCheck = [ + "multiset" + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; meta = with lib; { description = "An implementation of a multiset";