diff --git a/pkgs/development/python-modules/unittest2/collections-compat.patch b/pkgs/development/python-modules/unittest2/collections-compat.patch new file mode 100644 index 000000000000..350c9d716783 --- /dev/null +++ b/pkgs/development/python-modules/unittest2/collections-compat.patch @@ -0,0 +1,19 @@ +diff --git a/unittest2/compatibility.py b/unittest2/compatibility.py +index 9e5f1a5..473957c 100644 +--- a/unittest2/compatibility.py ++++ b/unittest2/compatibility.py +@@ -1,4 +1,5 @@ + import collections ++import collections.abc + import os + import sys + +@@ -140,7 +141,7 @@ except ImportError: + ### ChainMap (helper for configparser and string.Template) + ######################################################################## + +-class ChainMap(collections.MutableMapping): ++class ChainMap(collections.abc.MutableMapping): + ''' A ChainMap groups multiple dicts (or other mappings) together + to create a single, updateable view. + diff --git a/pkgs/development/python-modules/unittest2/default.nix b/pkgs/development/python-modules/unittest2/default.nix index e044176242d5..786b8996f83b 100644 --- a/pkgs/development/python-modules/unittest2/default.nix +++ b/pkgs/development/python-modules/unittest2/default.nix @@ -15,6 +15,10 @@ buildPythonPackage rec { sha256 = "0y855kmx7a8rnf81d3lh5lyxai1908xjp0laf4glwa4c8472m212"; }; + patches = lib.optionals (pythonAtLeast "3.7") [ + ./collections-compat.patch + ]; + propagatedBuildInputs = [ six traceback2 ]; # 1.0.0 and up create a circle dependency with traceback2/pbr @@ -34,7 +38,5 @@ buildPythonPackage rec { description = "A backport of the new features added to the unittest testing framework"; homepage = "https://pypi.org/project/unittest2/"; license = licenses.bsd0; - # AttributeError: module 'collections' has no attribute 'MutableMapping' - broken = pythonAtLeast "3.10"; }; } diff --git a/pkgs/tools/compression/zfp/default.nix b/pkgs/tools/compression/zfp/default.nix index c46c58e7b404..0b337f613366 100644 --- a/pkgs/tools/compression/zfp/default.nix +++ b/pkgs/tools/compression/zfp/default.nix @@ -1,4 +1,4 @@ -{ cmake, cudatoolkit, fetchFromGitHub, gfortran, lib, llvmPackages, pythonPackages, stdenv, targetPlatform +{ cmake, cudatoolkit, fetchFromGitHub, gfortran, lib, llvmPackages, python3Packages, stdenv, targetPlatform , enableCfp ? true , enableCuda ? false , enableExamples ? true @@ -23,7 +23,7 @@ stdenv.mkDerivation rec { buildInputs = lib.optional enableCuda cudatoolkit ++ lib.optional enableFortran gfortran ++ lib.optional enableOpenMP llvmPackages.openmp - ++ lib.optionals enablePython [ pythonPackages.cython pythonPackages.numpy pythonPackages.python ]; + ++ lib.optionals enablePython (with python3Packages; [ cython numpy python ]); cmakeFlags = [ # More tests not enabled by default