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