1{
2 lib,
3 attrs,
4 boltons,
5 buildPythonPackage,
6 face,
7 fetchPypi,
8 pytestCheckHook,
9 pythonAtLeast,
10 pythonOlder,
11 pyyaml,
12 setuptools,
13 tomli,
14}:
15
16buildPythonPackage rec {
17 pname = "glom";
18 version = "24.11.0";
19 pyproject = true;
20
21 disabled = pythonOlder "3.7";
22
23 src = fetchPypi {
24 inherit pname version;
25 hash = "sha256-QyX5Z1mpEgRK97bGvQ26RK2MHrYDiqsFcylmHSAhuyc=";
26 };
27
28 build-system = [ setuptools ];
29
30 dependencies = [
31 boltons
32 attrs
33 face
34 ];
35
36 optional-dependencies = {
37 toml = lib.optionals (pythonOlder "3.11") [ tomli ];
38 yaml = [ pyyaml ];
39 };
40
41 nativeCheckInputs = [
42 pytestCheckHook
43 ]
44 ++ lib.flatten (builtins.attrValues optional-dependencies);
45
46 preCheck = ''
47 # test_cli.py checks the output of running "glom"
48 export PATH=$out/bin:$PATH
49 '';
50
51 disabledTests = lib.optionals (pythonAtLeast "3.11") [
52 "test_regular_error_stack"
53 "test_long_target_repr"
54 "test_glom_error_stack"
55 "test_glom_error_double_stack"
56 "test_branching_stack"
57 "test_midway_branch"
58 "test_partially_failing_branch"
59 "test_coalesce_stack"
60 "test_nesting_stack"
61 "test_3_11_byte_code_caret"
62 ];
63
64 pythonImportsCheck = [ "glom" ];
65
66 meta = with lib; {
67 description = "Module for restructuring data";
68 longDescription = ''
69 glom helps pull together objects from other objects in a
70 declarative, dynamic, and downright simple way.
71 '';
72 homepage = "https://github.com/mahmoud/glom";
73 changelog = "https://github.com/mahmoud/glom/blob/v${version}/CHANGELOG.md";
74 license = licenses.bsd3;
75 maintainers = with maintainers; [ twey ];
76 mainProgram = "glom";
77 };
78}