1{
2 lib,
3 attrs,
4 buildPythonPackage,
5 docstring-parser,
6 fetchFromGitHub,
7 poetry-core,
8 poetry-dynamic-versioning,
9 pydantic,
10 pytest-mock,
11 pytestCheckHook,
12 pythonOlder,
13 pyyaml,
14 rich-rst,
15 rich,
16 trio,
17}:
18
19buildPythonPackage rec {
20 pname = "cyclopts";
21 version = "3.16.1";
22 pyproject = true;
23
24 disabled = pythonOlder "3.12";
25
26 src = fetchFromGitHub {
27 owner = "BrianPugh";
28 repo = "cyclopts";
29 tag = "v${version}";
30 hash = "sha256-Y9CTsKj7E2P6ZhN1k1VqiFbMhsB1dgDmfhlmbTxrszM=";
31 };
32
33 build-system = [
34 poetry-core
35 poetry-dynamic-versioning
36 ];
37
38 dependencies = [
39 attrs
40 docstring-parser
41 rich
42 rich-rst
43 ];
44
45 optional-dependencies = {
46 trio = [ trio ];
47 yaml = [ pyyaml ];
48 };
49
50 nativeCheckInputs = [
51 pydantic
52 pytest-mock
53 pytestCheckHook
54 pyyaml
55 ] ++ lib.flatten (builtins.attrValues optional-dependencies);
56
57 pythonImportsCheck = [ "cyclopts" ];
58
59 disabledTests = [
60 # Assertion error
61 "test_pydantic_error_msg"
62 ];
63
64 meta = with lib; {
65 description = "Module to create CLIs based on Python type hints";
66 homepage = "https://github.com/BrianPugh/cyclopts";
67 changelog = "https://github.com/BrianPugh/cyclopts/releases/tag/${src.tag}";
68 license = licenses.asl20;
69 maintainers = with maintainers; [ fab ];
70 };
71}