Merge pull request #171378 from fabaff/namedlist-fix

python310Packages.namedlist: add patch for collections.abc
This commit is contained in:
Fabian Affolter 2022-05-03 19:35:15 +02:00 committed by GitHub
commit 429af923fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,33 +1,54 @@
{ lib
, buildPythonPackage
, fetchPypi
, pytest
, fetchpatch
, pytestCheckHook
, pythonOlder
}:
buildPythonPackage rec {
pname = "namedlist";
version = "1.8";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
sha256 = "34f89fc992592c80b39a709e136edcf41ea17f24ba31eaf84a314a02c8b9bcef";
hash = "sha256-NPifyZJZLICzmnCeE27c9B6hfyS6Mer4SjFKAsi5vO8=";
};
checkInputs = [
pytestCheckHook
];
patches = [
# Deprecation warning using collections.abc, https://gitlab.com/ericvsmith/namedlist/-/merge_requests/1
(fetchpatch {
url = "https://gitlab.com/ericvsmith/namedlist/-/commit/102d15b455e6f058b9c95fe135167be82b34c14a.patch";
sha256 = "sha256-IfDgiObFFSOUnAlXR/+ye8uutGaFJ/AyQvCb76iNaMM=";
})
];
# Test file has a `unittest.main()` at the bottom that fails the tests;
# py.test can run the tests without it.
postPatch = ''
substituteInPlace test/test_namedlist.py --replace "unittest.main()" ""
'';
checkInputs = [ pytest ];
checkPhase = ''
py.test
'';
pythonImportsCheck = [
"namedlist"
];
meta = {
disabledTests = [
# AttributeError: module 'collections' has no attribute 'Container'
"test_ABC"
];
meta = with lib; {
description = "Similar to namedtuple, but instances are mutable";
homepage = "https://gitlab.com/ericvsmith/namedlist";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ ivan ];
license = licenses.asl20;
maintainers = with maintainers; [ ivan ];
};
}