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