2023-10-09 19:29:22 +00:00
|
|
|
{ lib
|
2024-02-07 01:22:34 +00:00
|
|
|
, appdirs
|
|
|
|
, argparse
|
2023-10-09 19:29:22 +00:00
|
|
|
, buildPythonPackage
|
2024-02-07 01:22:34 +00:00
|
|
|
, doit
|
2023-10-09 19:29:22 +00:00
|
|
|
, fetchPypi
|
|
|
|
, ftfy
|
2024-02-07 01:22:34 +00:00
|
|
|
, mock
|
|
|
|
, pyinstaller-versionfile
|
|
|
|
, pytestCheckHook
|
|
|
|
, python3
|
|
|
|
, pythonOlder
|
2023-10-09 19:29:22 +00:00
|
|
|
, requests
|
2024-02-07 01:22:34 +00:00
|
|
|
, pythonRelaxDepsHook
|
|
|
|
, setuptools
|
2023-10-09 19:29:22 +00:00
|
|
|
, setuptools-scm
|
2024-02-07 01:22:34 +00:00
|
|
|
, tableauserverclient
|
2023-10-09 19:29:22 +00:00
|
|
|
, types-appdirs
|
2024-02-07 01:22:34 +00:00
|
|
|
, types-mock
|
2023-10-09 19:29:22 +00:00
|
|
|
, types-requests
|
|
|
|
, types-setuptools
|
2024-02-07 01:22:34 +00:00
|
|
|
, urllib3
|
2023-10-09 19:29:22 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "tabcmd";
|
|
|
|
version = "2.0.12";
|
2024-02-07 01:22:34 +00:00
|
|
|
pyproject = true;
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-02-07 01:22:34 +00:00
|
|
|
hash = "sha256-nsQJWDzSzSc1WRk5TBl/E7Mpfk8wGD1CsETAWILKxCM=";
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
pythonRelaxDeps = [
|
|
|
|
"tableauserverclient"
|
|
|
|
"urllib3"
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pythonRelaxDepsHook
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
appdirs
|
|
|
|
argparse
|
|
|
|
doit
|
|
|
|
ftfy
|
|
|
|
pyinstaller-versionfile
|
|
|
|
requests
|
|
|
|
setuptools-scm
|
|
|
|
tableauserverclient
|
|
|
|
types-appdirs
|
|
|
|
types-mock
|
|
|
|
types-requests
|
|
|
|
types-setuptools
|
|
|
|
urllib3
|
|
|
|
];
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
mock
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
# Remove an unneeded dependency that can't be resolved
|
|
|
|
prePatch = ''
|
|
|
|
sed -i "/'argparse',/d" pyproject.toml
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Create a "tabcmd" executable
|
|
|
|
postInstall = ''
|
|
|
|
# Create a directory for our wrapped binary.
|
|
|
|
mkdir -p $out/bin
|
|
|
|
|
|
|
|
cp -r build/lib/tabcmd/__main__.py $out/bin/
|
|
|
|
|
|
|
|
# Create a 'tabcmd' script with python3 shebang
|
|
|
|
echo "#!${python3}/bin/python3" > $out/bin/tabcmd
|
|
|
|
|
|
|
|
# Append __main__.py contents
|
|
|
|
cat $out/bin/__main__.py >> $out/bin/tabcmd
|
|
|
|
|
|
|
|
# Make it executable.
|
|
|
|
chmod +x $out/bin/tabcmd
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
meta = with lib; {
|
2023-10-09 19:29:22 +00:00
|
|
|
description = "A command line client for working with Tableau Server.";
|
2024-02-07 01:22:34 +00:00
|
|
|
homepage = "https://github.com/tableau/tabcmd";
|
|
|
|
changelog = "https://github.com/tableau/tabcmd/releases/tag/v${version}";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ ];
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
}
|