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