1{ lib
2, buildPythonPackage
3, fetchPypi
4, fetchpatch
5, pytestCheckHook
6, pythonOlder
7}:
8
9buildPythonPackage rec {
10 pname = "namedlist";
11 version = "1.8";
12 format = "setuptools";
13
14 disabled = pythonOlder "3.7";
15
16 src = fetchPypi {
17 inherit pname version;
18 hash = "sha256-NPifyZJZLICzmnCeE27c9B6hfyS6Mer4SjFKAsi5vO8=";
19 };
20
21 nativeCheckInputs = [
22 pytestCheckHook
23 ];
24
25 patches = [
26 # Deprecation warning using collections.abc, https://gitlab.com/ericvsmith/namedlist/-/merge_requests/1
27 (fetchpatch {
28 url = "https://gitlab.com/ericvsmith/namedlist/-/commit/102d15b455e6f058b9c95fe135167be82b34c14a.patch";
29 hash = "sha256-IfDgiObFFSOUnAlXR/+ye8uutGaFJ/AyQvCb76iNaMM=";
30 })
31 ];
32
33 # Test file has a `unittest.main()` at the bottom that fails the tests;
34 # py.test can run the tests without it.
35 postPatch = ''
36 substituteInPlace test/test_namedlist.py --replace "unittest.main()" ""
37 '';
38
39 pythonImportsCheck = [
40 "namedlist"
41 ];
42
43 disabledTests = [
44 # AttributeError: module 'collections' has no attribute 'Container'
45 "test_ABC"
46 ];
47
48 meta = with lib; {
49 description = "Similar to namedtuple, but instances are mutable";
50 homepage = "https://gitlab.com/ericvsmith/namedlist";
51 license = licenses.asl20;
52 maintainers = with maintainers; [ ivan ];
53 };
54}