1{
2 lib,
3 appdirs,
4 argparse,
5 buildPythonPackage,
6 doit,
7 fetchPypi,
8 ftfy,
9 mock,
10 pyinstaller-versionfile,
11 pytest-order,
12 pytestCheckHook,
13 python,
14 pythonOlder,
15 requests,
16 setuptools,
17 setuptools-scm,
18 tableauserverclient,
19 types-appdirs,
20 types-mock,
21 types-requests,
22 types-setuptools,
23 urllib3,
24}:
25
26buildPythonPackage rec {
27 pname = "tabcmd";
28 version = "2.0.14";
29 pyproject = true;
30
31 disabled = pythonOlder "3.7";
32
33 src = fetchPypi {
34 inherit pname version;
35 hash = "sha256-wyfKy0g2btdNMNviCd7brB+lwZvPcZ3/DnymdVjCGFg=";
36 };
37
38 prePatch = ''
39 # Remove an unneeded dependency that can't be resolved
40 # https://github.com/tableau/tabcmd/pull/282
41 sed -i "/'argparse',/d" pyproject.toml
42 '';
43
44 pythonRelaxDeps = [
45 "tableauserverclient"
46 "urllib3"
47 ];
48
49
50 build-system = [ setuptools ];
51
52 dependencies = [
53 appdirs
54 argparse
55 doit
56 ftfy
57 pyinstaller-versionfile
58 requests
59 setuptools-scm
60 tableauserverclient
61 types-appdirs
62 types-mock
63 types-requests
64 types-setuptools
65 urllib3
66 ];
67
68 nativeCheckInputs = [
69 mock
70 pytest-order
71 pytestCheckHook
72 ];
73
74 # Create a "tabcmd" executable
75 postInstall = ''
76 # Create a directory for our wrapped binary.
77 mkdir -p $out/bin
78
79 cp -r build/lib/tabcmd/__main__.py $out/bin/
80
81 # Create a 'tabcmd' script with python3 shebang
82 echo "#!${python.interpreter}" > $out/bin/tabcmd
83
84 # Append __main__.py contents
85 cat $out/bin/__main__.py >> $out/bin/tabcmd
86
87 # Make it executable.
88 chmod +x $out/bin/tabcmd
89 '';
90
91 pythonImportsCheck = [ "tabcmd" ];
92
93 meta = with lib; {
94 broken = true;
95 description = "Command line client for working with Tableau Server";
96 homepage = "https://github.com/tableau/tabcmd";
97 changelog = "https://github.com/tableau/tabcmd/releases/tag/v${version}";
98 license = licenses.mit;
99 maintainers = [ ];
100 mainProgram = "tabcmd";
101 };
102}