1{
2 lib,
3 buildPythonPackage,
4 docopt,
5 fetchFromGitHub,
6 flit-core,
7 hypothesis,
8 inform,
9 nestedtext,
10 pytestCheckHook,
11 pythonOlder,
12 quantiphy,
13 voluptuous,
14}:
15
16buildPythonPackage rec {
17 pname = "nestedtext";
18 version = "3.7";
19 format = "pyproject";
20
21 disabled = pythonOlder "3.7";
22
23 src = fetchFromGitHub {
24 owner = "KenKundert";
25 repo = "nestedtext";
26 tag = "v${version}";
27 hash = "sha256-lNqSmEmzuRGdXs/4mwKSh7yDGHnAykpIDIR+abbLCns=";
28 };
29
30 nativeBuildInputs = [ flit-core ];
31
32 propagatedBuildInputs = [ inform ];
33
34 nativeCheckInputs = [
35 docopt
36 hypothesis
37 quantiphy
38 pytestCheckHook
39 voluptuous
40 ];
41
42 # Tests depend on quantiphy. To avoid infinite recursion, tests are only
43 # enabled when building passthru.tests.
44 doCheck = false;
45
46 disabledTestPaths = [
47 # Avoids an ImportMismatchError.
48 "build"
49 # Examples are prefixed with test_
50 "examples/"
51 ];
52
53 passthru.tests = {
54 runTests = nestedtext.overrideAttrs (_: {
55 doCheck = true;
56 });
57 };
58
59 pythonImportsCheck = [ "nestedtext" ];
60
61 meta = with lib; {
62 description = "Human friendly data format";
63 longDescription = ''
64 NestedText is a file format for holding data that is to be entered,
65 edited, or viewed by people. It allows data to be organized into a nested
66 collection of dictionaries, lists, and strings. In this way it is similar
67 to JSON, YAML and TOML, but without the complexity and risk of YAML and
68 without the syntactic clutter of JSON and TOML. NestedText is both simple
69 and natural. Only a small number of concepts and rules must be kept in
70 mind when creating it. It is easily created, modified, or viewed with a
71 text editor and easily understood and used by both programmers and
72 non-programmers.
73 '';
74 homepage = "https://nestedtext.org";
75 changelog = "https://github.com/KenKundert/nestedtext/blob/v${version}/doc/releases.rst";
76 license = licenses.mit;
77 maintainers = with maintainers; [ jeremyschlatter ];
78 };
79}