about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/nestedtext/default.nix
blob: 185fffba413a8216ebbbfbbdb0c87e65329db5ab (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
{ lib
, buildPythonPackage
, docopt
, fetchFromGitHub
, flit-core
, hypothesis
, inform
, nestedtext
, pytestCheckHook
, pythonOlder
, quantiphy
, voluptuous
}:

buildPythonPackage rec {
  pname = "nestedtext";
  version = "3.6";
  format = "pyproject";

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "KenKundert";
    repo = "nestedtext";
    rev = "refs/tags/v${version}";
    hash = "sha256-SHY/MTmYbNh3azkyvwEtuvT+V7YzfLi2B3FvBzv6Omo=";
  };

  nativeBuildInputs = [
    flit-core
  ];

  propagatedBuildInputs = [
    inform
  ];

  nativeCheckInputs = [
    docopt
    hypothesis
    quantiphy
    pytestCheckHook
    voluptuous
  ];

  # Tests depend on quantiphy. To avoid infinite recursion, tests are only
  # enabled when building passthru.tests.
  doCheck = false;

  pytestFlagsArray = [
    # Avoids an ImportMismatchError.
    "--ignore=build"
  ];

  disabledTestPaths = [
    # Examples are prefixed with test_
    "examples/"
  ];

  passthru.tests = {
    runTests = nestedtext.overrideAttrs (_: { doCheck = true; });
  };

  pythonImportsCheck = [
    "nestedtext"
  ];

  meta = with lib; {
    description = "A human friendly data format";
    longDescription = ''
      NestedText is a file format for holding data that is to be entered,
      edited, or viewed by people. It allows data to be organized into a nested
      collection of dictionaries, lists, and strings. In this way it is similar
      to JSON, YAML and TOML, but without the complexity and risk of YAML and
      without the syntactic clutter of JSON and TOML. NestedText is both simple
      and natural. Only a small number of concepts and rules must be kept in
      mind when creating it. It is easily created, modified, or viewed with a
      text editor and easily understood and used by both programmers and
      non-programmers.
    '';
    homepage = "https://nestedtext.org";
    changelog = "https://github.com/KenKundert/nestedtext/blob/v${version}/doc/releases.rst";
    license = licenses.mit;
    maintainers = with maintainers; [ jeremyschlatter ];
  };
}