1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, mock
5, pytestCheckHook
6, pyyaml
7, pythonOlder
8}:
9
10buildPythonPackage rec {
11 pname = "configargparse";
12 version = "1.7";
13 format = "setuptools";
14
15 disabled = pythonOlder "3.7";
16
17 src = fetchFromGitHub {
18 owner = "bw2";
19 repo = "ConfigArgParse";
20 rev = "refs/tags/${version}";
21 hash = "sha256-m77MY0IZ1AJkd4/Y7ltApvdF9y17Lgn92WZPYTCU9tA=";
22 };
23
24 passthru.optional-dependencies = {
25 yaml = [
26 pyyaml
27 ];
28 };
29
30 nativeCheckInputs = [
31 pytestCheckHook
32 mock
33 ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
34
35 pythonImportsCheck = [
36 "configargparse"
37 ];
38
39 meta = with lib; {
40 description = "A drop-in replacement for argparse";
41 homepage = "https://github.com/bw2/ConfigArgParse";
42 changelog = "https://github.com/bw2/ConfigArgParse/releases/tag/${version}";
43 license = licenses.mit;
44 maintainers = with maintainers; [ willibutz ];
45 };
46}