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,
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.0";
28 format = "pyproject";
29
30 disabled = pythonOlder "3.7";
31
32 src = fetchFromGitHub {
33 owner = "thombashi";
34 repo = pname;
35 rev = "refs/tags/v${version}";
36 hash = "sha256-b3YzDqNATaT/FFG4/x9EGlYlhXKPvgNB2xnm0bzvLJQ=";
37 };
38
39 nativeBuildInputs = [ setuptools ];
40
41 propagatedBuildInputs = [
42 dataproperty
43 mbstrdecoder
44 pathvalidate
45 tabledata
46 tcolorpy
47 typepy
48 ];
49
50 passthru.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 ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
88
89 pythonImportsCheck = [ "pathvalidate" ];
90
91 disabledTests = [
92 # Circular dependency
93 "test_normal_from_file"
94 "test_normal_from_text"
95 "test_normal_clear_theme"
96 # Test compares CLI output
97 "test_normal"
98 ];
99
100 disabledTestPaths = [
101 "test/writer/binary/test_excel_writer.py"
102 "test/writer/binary/test_sqlite_writer.py"
103 "test/writer/test_elasticsearch_writer.py"
104 ];
105
106 meta = with lib; {
107 description = "Library to write a table in various formats";
108 homepage = "https://github.com/thombashi/pytablewriter";
109 changelog = "https://github.com/thombashi/pytablewriter/releases/tag/v${version}";
110 license = licenses.mit;
111 maintainers = with maintainers; [ genericnerdyusername ];
112 };
113}