dae973cb59
GitOrigin-RevId: c90c4025bb6e0c4eaf438128a3b2640314b1c58d
85 lines
2 KiB
Nix
85 lines
2 KiB
Nix
{ lib
|
|
, buildPythonPackage
|
|
, docopt
|
|
, fetchFromGitHub
|
|
, flitBuildHook
|
|
, hypothesis
|
|
, inform
|
|
, nestedtext
|
|
, pytestCheckHook
|
|
, pythonOlder
|
|
, quantiphy
|
|
, voluptuous
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "nestedtext";
|
|
version = "3.5";
|
|
format = "pyproject";
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "KenKundert";
|
|
repo = "nestedtext";
|
|
rev = "refs/tags/v${version}";
|
|
hash = "sha256-RGCcrGsDkBhThuUZd2LuuyXG9r1S7iOA75HYRxkwUrU=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
flitBuildHook
|
|
];
|
|
|
|
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 ];
|
|
};
|
|
}
|