summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/glom/default.nix
blob: 587dd553f8536d3a0034761c42759ac0b6c8a23f (plain)
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
70
71
72
73
74
75
76
{
  lib,
  attrs,
  boltons,
  buildPythonPackage,
  face,
  fetchPypi,
  pytestCheckHook,
  pythonAtLeast,
  pythonOlder,
  pyyaml,
  setuptools,
  tomli,
}:

buildPythonPackage rec {
  pname = "glom";
  version = "25.12.0";
  pyproject = true;

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

  build-system = [ setuptools ];

  dependencies = [
    boltons
    attrs
    face
  ];

  optional-dependencies = {
    toml = lib.optionals (pythonOlder "3.11") [ tomli ];
    yaml = [ pyyaml ];
  };

  nativeCheckInputs = [
    pytestCheckHook
  ]
  ++ lib.concatAttrValues optional-dependencies;

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

  disabledTests = lib.optionals (pythonAtLeast "3.11") [
    "test_regular_error_stack"
    "test_long_target_repr"
    "test_glom_error_stack"
    "test_glom_error_double_stack"
    "test_branching_stack"
    "test_midway_branch"
    "test_partially_failing_branch"
    "test_coalesce_stack"
    "test_nesting_stack"
    "test_3_11_byte_code_caret"
  ];

  pythonImportsCheck = [ "glom" ];

  meta = {
    description = "Module for restructuring data";
    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 = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ twey ];
    mainProgram = "glom";
  };
}