1{
2 lib,
3 attrs,
4 boltons,
5 buildPythonPackage,
6 face,
7 fetchPypi,
8 pytestCheckHook,
9 pythonAtLeast,
10 pythonOlder,
11 pyyaml,
12}:
13
14buildPythonPackage rec {
15 pname = "glom";
16 version = "23.5.0";
17 format = "setuptools";
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchPypi {
22 inherit pname version;
23 hash = "sha256-Bq9eNIaqzFk4K6NOU+vqvXqTRdePfby+4m8DuqS4O6w=";
24 };
25
26 postPatch = ''
27 substituteInPlace setup.py \
28 --replace "face==20.1.1" "face"
29 '';
30
31 propagatedBuildInputs = [
32 boltons
33 attrs
34 face
35 ];
36
37 nativeCheckInputs = [
38 pytestCheckHook
39 pyyaml
40 ];
41
42 preCheck = ''
43 # test_cli.py checks the output of running "glom"
44 export PATH=$out/bin:$PATH
45 '';
46
47 disabledTests =
48 [
49 # Test is outdated (was made for PyYAML 3.x)
50 "test_main_yaml_target"
51 ]
52 ++ lib.optionals (pythonAtLeast "3.11") [
53 "test_regular_error_stack"
54 "test_long_target_repr"
55 ];
56
57 pythonImportsCheck = [ "glom" ];
58
59 meta = with lib; {
60 description = "Restructuring data, the Python way";
61 mainProgram = "glom";
62 longDescription = ''
63 glom helps pull together objects from other objects in a
64 declarative, dynamic, and downright simple way.
65 '';
66 homepage = "https://github.com/mahmoud/glom";
67 changelog = "https://github.com/mahmoud/glom/blob/v${version}/CHANGELOG.md";
68 license = licenses.bsd3;
69 maintainers = with maintainers; [ twey ];
70 };
71}