about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/glom/default.nix
blob: 05c6110ae7c9a4a2331e6e51668e6cfb81f6c7cc (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{ lib
, attrs
, boltons
, buildPythonPackage
, face
, fetchPypi
, pytestCheckHook
, pythonAtLeast
, pythonOlder
, pyyaml
}:

buildPythonPackage rec {
  pname = "glom";
  version = "23.5.0";
  format = "setuptools";

  disabled = pythonOlder "3.7";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-Bq9eNIaqzFk4K6NOU+vqvXqTRdePfby+4m8DuqS4O6w=";
  };

  postPatch = ''
    substituteInPlace setup.py \
      --replace "face==20.1.1" "face"
  '';

  propagatedBuildInputs = [
    boltons
    attrs
    face
  ];

  nativeCheckInputs = [
    pytestCheckHook
    pyyaml
  ];

  preCheck = ''
    # test_cli.py checks the output of running "glom"
    export PATH=$out/bin:$PATH
  '';

  disabledTests = [
    # Test is outdated (was made for PyYAML 3.x)
    "test_main_yaml_target"
  ] ++ lib.optionals (pythonAtLeast "3.11") [
    "test_regular_error_stack"
    "test_long_target_repr"
  ];

  pythonImportsCheck = [
    "glom"
  ];

  meta = with lib; {
    description = "Restructuring data, the Python way";
    longDescription = ''
      glom helps pull together objects from other objects in a
      declarative, dynamic, and downright simple way.
    '';
    homepage = "https://github.com/mahmoud/glom";
    changelog = "https://github.com/mahmoud/glom/blob/v${version}/CHANGELOG.md";
    license = licenses.bsd3;
    maintainers = with maintainers; [ twey ];
  };
}