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.24.0";
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-gJflZBH3xCGKffKGt7y1xGXQR8C1wK19LnbunZ0kbAc=";
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 ]
56 ++ lib.flatten (builtins.attrValues optional-dependencies);
57
58 pythonImportsCheck = [ "cyclopts" ];
59
60 disabledTests = [
61 # Assertion error
62 "test_pydantic_error_msg"
63 ];
64
65 meta = with lib; {
66 description = "Module to create CLIs based on Python type hints";
67 homepage = "https://github.com/BrianPugh/cyclopts";
68 changelog = "https://github.com/BrianPugh/cyclopts/releases/tag/${src.tag}";
69 license = licenses.asl20;
70 maintainers = with maintainers; [ fab ];
71 };
72}