Merge pull request #180103 from mweinelt/unittest2

This commit is contained in:
Martin Weinelt 2022-07-05 01:48:05 +02:00 committed by GitHub
commit 83809375c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 4 deletions

View File

@ -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.

View File

@ -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";
};
}

View File

@ -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