about summary refs log tree commit diff
path: root/pkgs/development/python-modules/namedlist/default.nix
blob: f4ddbb7dd7ab6e4faa8d1795fc5ab49bd222a278 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{
  lib,
  buildPythonPackage,
  fetchPypi,
  fetchpatch,
  pytestCheckHook,
  pythonOlder,
}:

buildPythonPackage rec {
  pname = "namedlist";
  version = "1.8";
  format = "setuptools";

  disabled = pythonOlder "3.7";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-NPifyZJZLICzmnCeE27c9B6hfyS6Mer4SjFKAsi5vO8=";
  };

  nativeCheckInputs = [ 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";
      hash = "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()" ""
  '';

  pythonImportsCheck = [ "namedlist" ];

  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 = licenses.asl20;
    maintainers = with maintainers; [ ivan ];
  };
}