1{ 2 lib, 3 buildPythonPackage, 4 dataproperty, 5 dominate, 6 elasticsearch, 7 fetchFromGitHub, 8 loguru, 9 mbstrdecoder, 10 pandas, 11 pathvalidate, 12 pytestCheckHook, 13 pythonOlder, 14 pyyaml, 15 setuptools-scm, 16 simplejson, 17 tabledata, 18 tcolorpy, 19 toml, 20 typepy, 21 xlsxwriter, 22 xlwt, 23}: 24 25buildPythonPackage rec { 26 pname = "pytablewriter"; 27 version = "1.2.1"; 28 pyproject = true; 29 30 disabled = pythonOlder "3.7"; 31 32 src = fetchFromGitHub { 33 owner = "thombashi"; 34 repo = "pytablewriter"; 35 tag = "v${version}"; 36 hash = "sha256-YuuSMKTSG3oybvA6TDWNnGg4EiDAw2tRlM0S9mBQlkc="; 37 }; 38 39 build-system = [ setuptools-scm ]; 40 41 dependencies = [ 42 dataproperty 43 mbstrdecoder 44 pathvalidate 45 tabledata 46 tcolorpy 47 typepy 48 ]; 49 50 optional-dependencies = { 51 all = [ 52 dominate 53 elasticsearch 54 loguru 55 pandas 56 # pytablereader 57 pyyaml 58 simplejson 59 toml 60 xlsxwriter 61 xlwt 62 ]; 63 es = [ elasticsearch ]; 64 es8 = [ elasticsearch ]; 65 excel = [ 66 xlwt 67 xlsxwriter 68 ]; 69 html = [ dominate ]; 70 logging = [ loguru ]; 71 # from = [ 72 # pytablereader 73 # ]; 74 pandas = [ pandas ]; 75 # sqlite = [ 76 # simplesqlite 77 # ]; 78 # theme = [ 79 # pytablewriter-altrow-theme 80 # ]; 81 toml = [ toml ]; 82 yaml = [ pyyaml ]; 83 }; 84 85 nativeCheckInputs = [ 86 pytestCheckHook 87 ] 88 ++ lib.flatten (builtins.attrValues optional-dependencies); 89 90 pythonImportsCheck = [ "pathvalidate" ]; 91 92 disabledTests = [ 93 # Circular dependency 94 "test_normal_from_file" 95 "test_normal_from_text" 96 "test_normal_clear_theme" 97 # Test compares CLI output 98 "test_normal" 99 ]; 100 101 disabledTestPaths = [ 102 "test/writer/binary/test_excel_writer.py" 103 "test/writer/binary/test_sqlite_writer.py" 104 "test/writer/test_elasticsearch_writer.py" 105 ]; 106 107 meta = { 108 description = "Library to write a table in various formats"; 109 homepage = "https://github.com/thombashi/pytablewriter"; 110 changelog = "https://github.com/thombashi/pytablewriter/releases/tag/${src.tag}"; 111 license = lib.licenses.mit; 112 maintainers = with lib.maintainers; [ genericnerdyusername ]; 113 }; 114}